Class ResourceIcon

java.lang.Object
uk.ac.starlink.topcat.ResourceIcon
All Implemented Interfaces:
Icon

public class ResourceIcon extends Object implements Icon
Handles the procurement of icons and other graphics for the TableViewer and related classes. All the icons required by these classes are provided as static final members of this class.

This class should really implement Icon rather than extending ImageIcon. However in Sun's J2SE1.4 AbstractButton implementation there is a bit where it will only grey out the icon if it actually is an ImageIcon. So we inherit from there.

Author:
Mark Taylor (Starlink)
  • Field Details

    • PREFIX

      public static final String PREFIX
      Location of image resource files relative to this class.
      See Also:
    • DO_WHAT

      public static final ImageIcon DO_WHAT
    • TABLE

      public static final ImageIcon TABLE
    • TOPCAT_LOGO_SMALL

      public static final ImageIcon TOPCAT_LOGO_SMALL
    • TOPCAT_LOGO_XM

      public static final ImageIcon TOPCAT_LOGO_XM
    • TOPCAT_LOGO_XM_SMALL

      public static final ImageIcon TOPCAT_LOGO_XM_SMALL
    • CLOSE

      public static final ImageIcon CLOSE
    • EXIT

      public static final ImageIcon EXIT
    • LOAD

      public static final ImageIcon LOAD
    • SAVE

      public static final ImageIcon SAVE
    • IMPORT

      public static final ImageIcon IMPORT
    • PRINT

      public static final ImageIcon PRINT
    • IMAGE

      public static final ImageIcon IMAGE
    • FITS

      public static final ImageIcon FITS
    • COPY

      public static final ImageIcon COPY
    • REDO

      public static final ImageIcon REDO
    • PAUSE

      public static final ImageIcon PAUSE
    • SCROLL

      public static final ImageIcon SCROLL
    • ADD

      public static final ImageIcon ADD
    • SUBTRACT

      public static final ImageIcon SUBTRACT
    • DELETE

      public static final ImageIcon DELETE
    • HELP

      public static final ImageIcon HELP
    • HELP_BROWSER

      public static final ImageIcon HELP_BROWSER
    • DEMO

      public static final ImageIcon DEMO
    • HIDE

      public static final ImageIcon HIDE
    • REVEAL

      public static final ImageIcon REVEAL
    • HIDE_ALL

      public static final ImageIcon HIDE_ALL
    • REVEAL_ALL

      public static final ImageIcon REVEAL_ALL
    • HIDE_ALL_TINY

      public static final ImageIcon HIDE_ALL_TINY
    • REVEAL_ALL_TINY

      public static final ImageIcon REVEAL_ALL_TINY
    • MODIFY

      public static final ImageIcon MODIFY
    • LOG

      public static final ImageIcon LOG
    • CLEAR

      public static final ImageIcon CLEAR
    • HIDE_WINDOWS

      public static final ImageIcon HIDE_WINDOWS
    • SCROLLER

      public static final ImageIcon SCROLLER
    • PARALLEL

      public static final ImageIcon PARALLEL
    • STILTS

      public static final ImageIcon STILTS
    • EDIT

      public static final ImageIcon EDIT
    • CONTROL

      public static final ImageIcon CONTROL
    • COLUMNS

      public static final ImageIcon COLUMNS
    • STATS

      public static final ImageIcon STATS
    • HISTOGRAM

      public static final ImageIcon HISTOGRAM
    • CUMULATIVE

      public static final ImageIcon CUMULATIVE
    • NORMALISE

      public static final ImageIcon NORMALISE
    • PLOT

      public static final ImageIcon PLOT
    • DENSITY

      public static final ImageIcon DENSITY
    • PLOT3D

      public static final ImageIcon PLOT3D
    • SPHERE

      public static final ImageIcon SPHERE
    • STACK

      public static final ImageIcon STACK
    • PARAMS

      public static final ImageIcon PARAMS
    • VIEWER

      public static final ImageIcon VIEWER
    • SUBSETS

      public static final ImageIcon SUBSETS
    • FUNCTION

      public static final ImageIcon FUNCTION
    • MATCH1

      public static final ImageIcon MATCH1
    • MATCH2

      public static final ImageIcon MATCH2
    • MATCHN

      public static final ImageIcon MATCHN
    • CONCAT

      public static final ImageIcon CONCAT
    • MULTICONE

      public static final ImageIcon MULTICONE
    • MULTISIA

      public static final ImageIcon MULTISIA
    • MULTISSA

      public static final ImageIcon MULTISSA
    • SAMP

      public static final ImageIcon SAMP
    • GAVO

      public static final ImageIcon GAVO
    • VIZIER

      public static final ImageIcon VIZIER
    • BASTI

      public static final ImageIcon BASTI
    • TREE_DIALOG

      public static final ImageIcon TREE_DIALOG
    • CLASSIFY

      public static final ImageIcon CLASSIFY
    • ACTIVATE

      public static final ImageIcon ACTIVATE
    • REACTIVATE

      public static final ImageIcon REACTIVATE
    • REACTIVATE_ALL

      public static final ImageIcon REACTIVATE_ALL
    • ACTIVATE_SEQ

      public static final ImageIcon ACTIVATE_SEQ
    • ACTIVATE_SEQ_ALL

      public static final ImageIcon ACTIVATE_SEQ_ALL
    • PAUSE_SEQ

      public static final ImageIcon PAUSE_SEQ
    • CANCEL_SEQ

      public static final ImageIcon CANCEL_SEQ
    • DELETE_INACTIVE

      public static final ImageIcon DELETE_INACTIVE
    • UNSORT

      public static final ImageIcon UNSORT
    • DELETE_COLUMN

      public static final ImageIcon DELETE_COLUMN
    • VISIBLE_SUBSET

      public static final ImageIcon VISIBLE_SUBSET
    • JEL_VISIBLE_SUBSET

      public static final ImageIcon JEL_VISIBLE_SUBSET
    • RANGE_SUBSET

      public static final ImageIcon RANGE_SUBSET
    • XRANGE_SUBSET

      public static final ImageIcon XRANGE_SUBSET
    • BLOB_SUBSET

      public static final ImageIcon BLOB_SUBSET
    • BLOB_SUBSET_END

      public static final ImageIcon BLOB_SUBSET_END
    • POLY_SUBSET

      public static final ImageIcon POLY_SUBSET
    • POLY_SUBSET_END

      public static final ImageIcon POLY_SUBSET_END
    • RESIZE

      public static final ImageIcon RESIZE
    • RESIZE_X

      public static final ImageIcon RESIZE_X
    • RESIZE_Y

      public static final ImageIcon RESIZE_Y
    • GRID_ON

      public static final ImageIcon GRID_ON
    • GRID_OFF

      public static final ImageIcon GRID_OFF
    • Y_CURSOR

      public static final ImageIcon Y_CURSOR
    • Y0_LINE

      public static final ImageIcon Y0_LINE
    • TO_COLUMN

      public static final ImageIcon TO_COLUMN
    • HIGHLIGHT

      public static final ImageIcon HIGHLIGHT
    • APPLY_SUBSET

      public static final ImageIcon APPLY_SUBSET
    • COUNT

      public static final ImageIcon COUNT
    • RECOUNT

      public static final ImageIcon RECOUNT
    • INVERT

      public static final ImageIcon INVERT
    • TAIL

      public static final ImageIcon TAIL
    • SAMPLE

      public static final ImageIcon SAMPLE
    • INCLUDE_ROWS

      public static final ImageIcon INCLUDE_ROWS
    • EXCLUDE_ROWS

      public static final ImageIcon EXCLUDE_ROWS
    • UP

      public static final ImageIcon UP
    • DOWN

      public static final ImageIcon DOWN
    • UP_TRIM

      public static final ImageIcon UP_TRIM
    • DOWN_TRIM

      public static final ImageIcon DOWN_TRIM
    • MOVE_UP

      public static final ImageIcon MOVE_UP
    • MOVE_DOWN

      public static final ImageIcon MOVE_DOWN
    • EQUATION

      public static final ImageIcon EQUATION
    • EXPLODE

      public static final ImageIcon EXPLODE
    • COLLAPSE

      public static final ImageIcon COLLAPSE
    • ADDSKY

      public static final ImageIcon ADDSKY
    • COLOR_LOG

      public static final ImageIcon COLOR_LOG
    • XLOG

      public static final ImageIcon XLOG
    • YLOG

      public static final ImageIcon YLOG
    • XFLIP

      public static final ImageIcon XFLIP
    • YFLIP

      public static final ImageIcon YFLIP
    • XYZ

      public static final ImageIcon XYZ
    • FOG

      public static final ImageIcon FOG
    • ANTIALIAS

      public static final ImageIcon ANTIALIAS
    • COLOR

      public static final ImageIcon COLOR
    • FINE

      public static final ImageIcon FINE
    • ROUGH

      public static final ImageIcon ROUGH
    • AXIS_EDIT

      public static final ImageIcon AXIS_EDIT
    • AXIS_LOCK

      public static final ImageIcon AXIS_LOCK
    • AUX_LOCK

      public static final ImageIcon AUX_LOCK
    • BROADCAST

      public static final ImageIcon BROADCAST
    • SEND

      public static final ImageIcon SEND
    • ADD_TAB

      public static final ImageIcon ADD_TAB
    • REMOVE_TAB

      public static final ImageIcon REMOVE_TAB
    • COLORS

      public static final ImageIcon COLORS
    • ADD_COLORS

      public static final ImageIcon ADD_COLORS
    • REMOVE_COLORS

      public static final ImageIcon REMOVE_COLORS
    • NORTH

      public static final ImageIcon NORTH
    • WEIGHT

      public static final ImageIcon WEIGHT
    • JPEG

      public static final ImageIcon JPEG
    • SPLIT

      public static final ImageIcon SPLIT
    • FORWARD

      public static final ImageIcon FORWARD
    • BACKWARD

      public static final ImageIcon BACKWARD
    • PAGE_SETUP

      public static final ImageIcon PAGE_SETUP
    • MANUAL

      public static final ImageIcon MANUAL
    • MANUAL_BROWSER

      public static final ImageIcon MANUAL_BROWSER
    • MANUAL1_BROWSER

      public static final ImageIcon MANUAL1_BROWSER
    • LEGEND

      public static final ImageIcon LEGEND
    • LABEL

      public static final ImageIcon LABEL
    • RADIAL

      public static final ImageIcon RADIAL
    • CONNECT

      public static final ImageIcon CONNECT
    • DISCONNECT

      public static final ImageIcon DISCONNECT
    • NO_HUB

      public static final ImageIcon NO_HUB
    • PDF

      public static final ImageIcon PDF
    • TUNING

      public static final ImageIcon TUNING
    • PROFILE

      public static final ImageIcon PROFILE
    • SYSTEM

      public static final ImageIcon SYSTEM
    • KEEP_OPEN

      public static final ImageIcon KEEP_OPEN
    • LISTEN

      public static final ImageIcon LISTEN
    • TO_BROWSER

      public static final ImageIcon TO_BROWSER
    • SYNTAX

      public static final ImageIcon SYNTAX
    • FOOTPRINT

      public static final ImageIcon FOOTPRINT
    • ZOOM_IN

      public static final ImageIcon ZOOM_IN
    • ZOOM_OUT

      public static final ImageIcon ZOOM_OUT
    • SKETCH

      public static final ImageIcon SKETCH
    • PROGRESS

      public static final ImageIcon PROGRESS
    • MATCHPLOT

      public static final ImageIcon MATCHPLOT
    • CDSXMATCH

      public static final ImageIcon CDSXMATCH
    • HISTO_SAVE

      public static final ImageIcon HISTO_SAVE
    • HISTO_IMPORT

      public static final ImageIcon HISTO_IMPORT
    • WARNING

      public static final ImageIcon WARNING
    • APPROVE_ALL

      public static final ImageIcon APPROVE_ALL
    • MEASURE

      public static final ImageIcon MEASURE
    • LOCK

      public static final ImageIcon LOCK
    • QAPPROX

      public static final ImageIcon QAPPROX
    • RESET_AUTH

      public static final ImageIcon RESET_AUTH
    • UP_DOWN

      public static final ImageIcon UP_DOWN
    • FLOAT

      public static final ImageIcon FLOAT
    • PLOT_DATA

      public static final ImageIcon PLOT_DATA
    • PLOT_PAIR

      public static final ImageIcon PLOT_PAIR
    • PLOT_QUAD

      public static final ImageIcon PLOT_QUAD
    • PLOT_HISTO

      public static final ImageIcon PLOT_HISTO
    • PLOT_AREA

      public static final ImageIcon PLOT_AREA
    • PLOT_VECTOR

      public static final ImageIcon PLOT_VECTOR
    • PLOT_MATRIX

      public static final ImageIcon PLOT_MATRIX
    • PLOT2_PLANE

      public static final ImageIcon PLOT2_PLANE
    • PLOT2_SKY

      public static final ImageIcon PLOT2_SKY
    • PLOT2_CUBE

      public static final ImageIcon PLOT2_CUBE
    • PLOT2_SPHERE

      public static final ImageIcon PLOT2_SPHERE
    • PLOT2_MATRIX

      public static final ImageIcon PLOT2_MATRIX
    • PLOT2_TIME

      public static final ImageIcon PLOT2_TIME
    • PLOT2_HISTOGRAM

      public static final ImageIcon PLOT2_HISTOGRAM
    • HISTOBARS

      public static final ImageIcon HISTOBARS
    • SMALL_CLOSE

      public static final ImageIcon SMALL_CLOSE
    • SMALL_HELP

      public static final ImageIcon SMALL_HELP
    • ADD_CONTROL

      public static final ImageIcon ADD_CONTROL
    • AXIS_CONFIG

      public static final ImageIcon AXIS_CONFIG
    • FRAME_CONFIG

      public static final ImageIcon FRAME_CONFIG
    • SAVE_OVERLAY

      public static final ImageIcon SAVE_OVERLAY
    • IMPORT_OVERLAY

      public static final ImageIcon IMPORT_OVERLAY
    • COLLAPSED

      public static final ImageIcon COLLAPSED
    • EXPANDED

      public static final ImageIcon EXPANDED
    • HOME

      public static final ImageIcon HOME
    • TV_UP

      public static final ImageIcon TV_UP
    • TV_DOWN

      public static final ImageIcon TV_DOWN
    • FOLDER_NODE

      public static final ImageIcon FOLDER_NODE
    • LIBRARY_NODE

      public static final ImageIcon LIBRARY_NODE
    • FUNCTION_NODE

      public static final ImageIcon FUNCTION_NODE
    • CONSTANT_NODE

      public static final ImageIcon CONSTANT_NODE
    • dummy

      public static final ImageIcon dummy
    • BLANK

      public static final Icon BLANK
      Blank icon.
  • Method Details

    • getIconHeight

      public int getIconHeight()
      Specified by:
      getIconHeight in interface Icon
    • getIconWidth

      public int getIconWidth()
      Specified by:
      getIconWidth in interface Icon
    • paintIcon

      public void paintIcon(Component c, Graphics g, int x, int y)
      Specified by:
      paintIcon in interface Icon
    • getImage

      public Image getImage()
      Returns an Image for this icon if it can, or null if it can't for some reason.
      Returns:
      an Image
    • getURL

      public URL getURL()
      Returns the URL for the image that forms this icon; it is called PREFIX + location relative to this class. This will probably be a jar: protocol URL and only useful to Java applications (possibly only within this JVM).
      Returns:
      the icon URL
    • getExternalURL

      public URL getExternalURL() throws IOException
      Returns a URL from which this icon can be retrieved by external applications. This is served from TOPCAT's internal HTTP server, and so is only available as long as this instance of the program is running.
      Returns:
      url, or null if no server is running
      Throws:
      IOException
    • combineIcons

      public static ImageIcon combineIcons(Icon[] icons)
      Paints a stack of icons on top of each other and returns the result. Later elements obscure earlier ones
      Parameters:
      icons - icon array
      Returns:
      combination
    • toAddIcon

      public static ImageIcon toAddIcon(Icon baseIcon)
      Doctors an icon representing a control to look like it means adding that control. Currently, it puts a little plus sign in the corner.
      Parameters:
      baseIcon - standard sized (24x24) base icon
      Returns:
      doctored icon
    • toSaveIcon

      public static ImageIcon toSaveIcon(Icon baseIcon)
      Doctors an icon look like it means saving data associated with that icon. Currently, it puts a little floppy disk icon in the corner.
      Parameters:
      baseIcon - standard sized (24x24) base icon
      Returns:
      doctored icon
    • toImportIcon

      public static ImageIcon toImportIcon(Icon baseIcon)
      Doctors an icon look like it means importing a table associated with that icon. Currently, it puts a little table icon in the corner.
      Parameters:
      baseIcon - standard sized (24x24) base icon
      Returns:
      doctored icon
    • getTopcatLogo

      public static Icon getTopcatLogo()
      Returns a full-size TOPCAT logo for display.
      Returns:
      topcat logo
    • getTopcatLogoSmall

      public static Icon getTopcatLogoSmall()
      Returns an icon-size TOPCAT logo.
      Returns:
      24x24 pixel topcat logo
    • checkResourcesPresent

      public static void checkResourcesPresent() throws FileNotFoundException
      Checks that all the required resource files are present for this class. If any of the image files are not present, it will throw an informative FileNotFoundException.
      Throws:
      FileNotFoundException - if any of the graphics files are missing
    • writeHelpMapXML

      public static void writeHelpMapXML(OutputStream ostrm, String prefix)
      Writes the <mapID> elements required for a JavaHelp map file representing the icons represented by this class. The URLs are relative to the location of the help files.
      Parameters:
      ostrm - the destination output stream for the data
      prefix - a string to prefix to each relative URL
    • main

      public static void main(String[] args) throws IOException
      Invokes the writeHelpMapXML(java.io.OutputStream, java.lang.String) method to standard output.
      Throws:
      IOException