|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--org.concord.biologica.ui.UIView | +--org.concord.biologica.ui.OrganismView
The basic organism view of BioLogica, used to hold all the code that is common to all views that draw organisms in a phenotypical manner.
An object of this class will generate the following property change events:
UIProp.BACKGROUND
,
UIProp.CHARACTERISTICS_TEXT_VISIBLE
,
UIProp.FONT
,
UIProp.FOREGROUND
,
UIProp.LOCK_SYMBOL_VISIBLE
,
UIProp.NAME_TEXT_VISIBLE
,
UIProp.ORGANISM_IMAGE_SIZE
,
UIProp.SEX_TEXT_VISIBLE
,
UIProp.SPECIES_TEXT_VISIBLE
,
UIProp.TEXT_INDENT
,
UIProp.TEXT_LINE_SPACING
,
PropertyChangeListener
, Serialized FormInner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
protected boolean |
characteristicsTextVisible
Characteristics text visible boolean flag. |
protected java.awt.Color |
highlightColor
Highlight color for a particular view |
protected Organism |
hotspotOrganism
Transient hotspot organism. |
protected OrganismImage |
hotspotOrganismImage
Transient hotspot organism image. |
protected boolean |
lockSymbolVisible
Lock symbol visible boolean flag |
protected boolean |
nameTextVisible
Name text visible boolean flag. |
protected int |
organismImageSize
Organism image size, used when drawing organisms. |
protected java.awt.Color |
selectionColor
Selection color for a particular view |
protected boolean |
sexTextVisible
Sex text visible boolean flag. |
protected boolean |
speciesTextVisible
Species text visible boolean flag. |
protected int |
textIndent
Indentation in pixels from left edge of image for text underneath the organism. |
protected int |
textLineSpacing
Text line spacing, the distance between lines of text under an organism. |
Fields inherited from class org.concord.biologica.ui.UIView |
changes, fontAscent, fontDescent, fontHeight, fontMetrics, preferredHeight, preferredWidth, scrollPane |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
OrganismView()
Creates an organism view. |
Method Summary | |
static java.awt.Color |
getDefaultHighlightColor()
Get the default selection color |
static java.awt.Color |
getDefaultSelectionColor()
Get the default selection color |
java.awt.Color |
getHighlightColor()
Get the highlight color |
protected java.awt.Dimension |
getOrganismCellDimensions(Organism organism,
int x,
int y,
int fontHeight,
boolean drawAsTrait)
Get organism cell dimensions, used when picking. |
int |
getOrganismImageSize()
Get the organism image size for this view. |
java.awt.Color |
getSelectionColor()
Get the selection color |
int |
getTextIndent()
Get the text indent for this view. |
int |
getTextLineSpacing()
Get the text line spacing for this view, the number of pixels between lines of text below an organism. |
boolean |
imageUpdate(java.awt.Image anImage,
int infoFlags,
int x,
int y,
int width,
int height)
ImageObserver method |
boolean |
isCharacteristicsTextVisible()
Is the characteristics text visible? |
boolean |
isLockSymbolVisible()
Is the lock symbol visible? |
boolean |
isNameTextVisible()
Is the name text visible? |
boolean |
isSexTextVisible()
Is the sex text visible? |
boolean |
isSpeciesTextVisible()
Is the species text visible? |
void |
preloadSpeciesImages(Species aSpecies)
Preload the species images for the given species at the current image size. |
void |
setCharacteristicsTextVisible(boolean aCharacteristicsTextVisible)
Set the characteristics text visible boolean. |
static void |
setDefaultHighlightColor(java.awt.Color aColor)
Set the default Highlight color. |
static void |
setDefaultSelectionColor(java.awt.Color aColor)
Set the default selection color. |
void |
setHighlightColor(java.awt.Color aColor)
Set the highlight color. |
void |
setLockSymbolVisible(boolean aLockSymbolVisible)
Set the lock symbol visible boolean. |
void |
setNameTextVisible(boolean aNameTextVisible)
Set the name text visible boolean. |
void |
setOrganismImageSize(int anOrganismImageSize)
Set the organism image size for this view. |
void |
setSelectionColor(java.awt.Color aColor)
Set the selection color. |
void |
setSexTextVisible(boolean aSexTextVisible)
Set the sex text visible boolean. |
void |
setSpeciesTextVisible(boolean aSpeciesTextVisible)
Set the species text visible boolean. |
void |
setTextIndent(int aTextIndent)
Set the text indent for this view. |
void |
setTextLineSpacing(int aTextLineSpacing)
Set the text line spacing for this view, the number of pixels between lines of text below an organism. |
protected void |
updateHotspotOnMousePress(Organism anOrganism,
int xMouse,
int yMouse)
Update the hotspot state given that the user has pressed the mouse on the given organism at the given location in this view. |
protected void |
updateHotspotOnMouseReleased()
Update the hotspot state given that the user has released the mouse. |
Methods inherited from class org.concord.biologica.ui.UIView |
addPropertyChangeListener, getLocalImage, getPreferredSize, paintBackground, removePropertyChangeListener, setBackground, setFont, setForeground, setScrollPane, toolChanged, updateFont |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean lockSymbolVisible
protected boolean nameTextVisible
protected boolean sexTextVisible
protected boolean speciesTextVisible
protected boolean characteristicsTextVisible
protected int organismImageSize
protected int textIndent
protected int textLineSpacing
protected transient Organism hotspotOrganism
protected transient OrganismImage hotspotOrganismImage
protected java.awt.Color highlightColor
protected java.awt.Color selectionColor
Constructor Detail |
public OrganismView()
Method Detail |
public static java.awt.Color getDefaultHighlightColor()
public static void setDefaultHighlightColor(java.awt.Color aColor)
aColor
- Color - a default Highlight color, may not be nulljava.lang.IllegalArgumentException
- - input argument illegal (null)public static java.awt.Color getDefaultSelectionColor()
public static void setDefaultSelectionColor(java.awt.Color aColor)
aColor
- Color - a default selection color, may not be nulljava.lang.IllegalArgumentException
- - input argument illegal (null)public boolean isLockSymbolVisible()
public void setLockSymbolVisible(boolean aLockSymbolVisible)
aLockSymbolVisible
- boolean - visible?public boolean isCharacteristicsTextVisible()
public void setCharacteristicsTextVisible(boolean aCharacteristicsTextVisible)
aCharacteristicsTextVisible
- boolean - visible?public boolean isNameTextVisible()
public void setNameTextVisible(boolean aNameTextVisible)
aNameTextVisible
- boolean - visible?public boolean isSexTextVisible()
public void setSexTextVisible(boolean aSexTextVisible)
aSexTextVisible
- boolean - visible?public boolean isSpeciesTextVisible()
public void setSpeciesTextVisible(boolean aSpeciesTextVisible)
aSpeciesTextVisible
- boolean - visible?public java.awt.Color getHighlightColor()
public void setHighlightColor(java.awt.Color aColor)
aColor
- Color - a new highlight color, may be nullpublic java.awt.Color getSelectionColor()
public void setSelectionColor(java.awt.Color aColor)
aColor
- Color - a new selection color, may be nullpublic void preloadSpeciesImages(Species aSpecies)
Note that this is just a performance enhancement and is not something a user of the BioLogica engine must call. It just speeds drawing of the first organism of this species at this image size.
aSpecies
- Species - a speciespublic int getOrganismImageSize()
public void setOrganismImageSize(int anOrganismImageSize)
anOrganismImageSize
- int - a new organism image sizejava.lang.IllegalArgumentException
- - illegal input valuepublic int getTextIndent()
public void setTextIndent(int aTextIndent)
aTextIndent
- int - a new text indentpublic int getTextLineSpacing()
public void setTextLineSpacing(int aTextLineSpacing)
aTextLineSpacing
- int - a new text line spacingpublic boolean imageUpdate(java.awt.Image anImage, int infoFlags, int x, int y, int width, int height)
imageUpdate
in interface java.awt.image.ImageObserver
imageUpdate
in class java.awt.Component
protected java.awt.Dimension getOrganismCellDimensions(Organism organism, int x, int y, int fontHeight, boolean drawAsTrait)
organism
- Organism - the organism to drawx
- int - x locationy
- int - y locationfontHeight
- int - font heightdrawAsTrait
- boolean - is organism drawn as a trait?protected void updateHotspotOnMousePress(Organism anOrganism, int xMouse, int yMouse)
anOrganism
- Organism - the organism that the user has pressed onxMouse
- int - x coordinate of mouse press relative to topleft of organism's cellyMouse
- int - y coordinate of mouse press relative to topleft of organism's cellprotected void updateHotspotOnMouseReleased()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |