|
|||||||||
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 | +--javax.swing.JPanel | +--fsmvis.gui.ScatterPanel
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
protected boolean |
animating
|
static java.awt.Color |
BACKGROUND
|
protected int |
colorField
|
protected java.awt.Color[] |
colorScheme
|
static double |
DATA_DOT_SIZE
|
protected int |
dataSize
|
protected long |
delay
|
static java.awt.Color |
DES_TRAIL_COL
|
static java.awt.Color |
DESELECTED_DOT
|
protected boolean |
drawTrails
|
protected int |
height
|
static long |
MAX_DELAY
|
protected java.lang.Thread |
me
|
protected LayoutModel |
model
|
protected MouseHandler |
mouse
|
protected boolean |
notFirst
|
protected double |
offsetX
|
protected double |
offsetY
|
protected java.awt.Point |
origin
|
protected Viewer |
parent
|
protected boolean |
paused
|
protected PropertiesHandler |
properties
|
protected java.awt.Rectangle |
rec
|
protected boolean |
running
|
protected double |
scaleX
|
protected double |
scaleY
|
protected SelectionHandler |
selected
|
protected int |
selectedCol
|
protected java.util.Set |
selection
|
static java.awt.Color |
TRAIL_COLOR
|
static double |
TRAIL_DOT_SIZE
|
static int |
TRAIL_LENGTH
|
protected java.util.ArrayList |
trails
|
protected int |
width
|
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 |
Constructor Summary | |
ScatterPanel(LayoutModel model)
|
|
ScatterPanel(LayoutModel model,
Viewer parent)
|
Method Summary | |
void |
addToSelection(java.awt.Rectangle rect)
Adds all the data items which are within the on screen rectangle rect to the currently selected indices that this object holds |
double |
calcPosX(double x)
calculates the x position that this object should be at within the current JPanel and layoutbounds of the layoutModel |
double |
calcPosY(double y)
calculates the y position that this object should be at within the current JPanel and layoutbounds of the layoutModel |
protected void |
drawDot(java.awt.Graphics g,
int index,
java.awt.Color col)
Draws a dot located at index index in the data item collection, with the color col. |
protected void |
drawTrail(java.awt.Graphics g,
int index,
java.awt.Color color)
Draws a trail on the data item with index index. |
long |
getDelay()
Returns the current delay between iterations |
java.util.Collection |
getDeselection()
Returns the indices of the deselected items in this object This method may return null if the getSelection method is being used instead. |
java.awt.Color |
getDotColor(int index)
Returns the dot with index current drawing color, gets this from the ColorScales class by looking up this dots colour relative to the current colorScheme and colorField. |
double |
getOffsetX()
Returns the x offset value |
double |
getOffsetY()
Returns the y offset value |
java.awt.Point |
getOrigin()
Returns the Point at the centre of the display, the origin |
protected java.util.Collection |
getRectContents(java.awt.Rectangle rect)
Returns the indices of the data items that are contained inside the on screen rectangle rect. |
double |
getScaleX()
Returns the current value of scale in the x direction |
double |
getScaleY()
Returns the current value of scale in the y direction |
java.util.Collection |
getSelection()
Returns the selection of this object |
java.awt.Point |
getToolTipLocation(java.awt.event.MouseEvent event)
Sets the location that the tool tip should be displayed at |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent event)
Sets the tool tip text to be displayed to be relative to the data element under the cursor |
void |
handleSelection(java.awt.Rectangle rect)
Sets the currently selected indices of the scatter panel to be the indices of the data items held within rect |
protected void |
initProperties()
Initialises the properties associated with this object |
void |
newThread()
|
void |
paint(java.awt.Graphics g)
Overrides the standard paint method, displays all the dots onto the screen |
void |
pause()
Pauses the layout model |
void |
removeFromSelection(java.awt.Rectangle rect)
Removes all the data items which are within the on screen rectangle rect from the currently selected indices that this object holds |
void |
reset()
resets the scale and offset values to their original values. |
void |
run()
run method defined by runnable interface |
void |
selectAll()
Sets this selectable object to select all its items |
void |
selectionChanged(SelectionHandler select)
Method that will be called the selection is changed in the selection handler |
void |
selectNone()
Sets this selectable item to select none of it items |
void |
setAnimate(boolean animating)
|
void |
setColorField(java.lang.String field)
|
void |
setColorScheme(java.lang.String color)
Sets the color scheme for the scatter panel to use |
void |
setDelay(long delay)
Sets the delay between calls to do runIteration |
void |
setDrawTrails(boolean drawTrails)
Sets whether or not the scatter panel should draw trails on the data items |
void |
setModel(LayoutModel model)
called when the layout model that is being used has changed |
void |
setOffsetX(double offsetX)
sets the x offset value |
void |
setOffsetY(double offsetY)
sets the y offset value |
void |
setRect(java.awt.Rectangle r)
Stores the last drawn rectangle |
void |
setScale(double scaleX,
double scaleY)
Sets the scale to be the new value scale |
void |
setScaleX(double scaleX)
Sets the x scale to be the new value scale |
void |
setScaleY(double scaleY)
Sets the y scale to be the new value scale |
void |
setSelectedColumn(java.lang.String colName)
Sets the selected column value, this is used for the tooltips to give a value |
void |
start()
starts the layout model |
void |
threadRunning(boolean r)
|
void |
update()
Method that should be called whenever an screen update is required, |
void |
updateTrails()
updates the contents of the trails information. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update |
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,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
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,
printAll,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
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 LayoutModel model
protected Viewer parent
protected int dataSize
protected java.lang.Thread me
protected volatile boolean running
protected volatile boolean drawTrails
protected volatile boolean paused
protected volatile boolean animating
protected volatile long delay
protected int width
protected int height
protected double scaleX
protected double scaleY
protected double offsetX
protected double offsetY
protected java.awt.Point origin
protected java.util.ArrayList trails
protected PropertiesHandler properties
protected SelectionHandler selected
protected java.util.Set selection
protected MouseHandler mouse
protected java.awt.Color[] colorScheme
protected int colorField
protected int selectedCol
public static double DATA_DOT_SIZE
public static double TRAIL_DOT_SIZE
public static int TRAIL_LENGTH
public static java.awt.Color TRAIL_COLOR
public static java.awt.Color DES_TRAIL_COL
public static java.awt.Color DESELECTED_DOT
public static java.awt.Color BACKGROUND
public static long MAX_DELAY
protected java.awt.Rectangle rec
protected boolean notFirst
Constructor Detail |
public ScatterPanel(LayoutModel model, Viewer parent)
public ScatterPanel(LayoutModel model)
Method Detail |
protected void initProperties()
public void pause()
public void start()
public void run()
public void update()
public void paint(java.awt.Graphics g)
protected void drawDot(java.awt.Graphics g, int index, java.awt.Color col)
protected void drawTrail(java.awt.Graphics g, int index, java.awt.Color color)
g
- index
- col
- public double calcPosX(double x)
public double calcPosY(double y)
public java.awt.Color getDotColor(int index)
index
- The index of the dot to retrieve color forpublic void setModel(LayoutModel model)
model
- The new layout model to usepublic void setDrawTrails(boolean drawTrails)
drawTrails
- Sets the state of draw trailspublic void newThread()
public void threadRunning(boolean r)
public void setAnimate(boolean animating)
public void updateTrails()
public void handleSelection(java.awt.Rectangle rect)
rect
- The rectangle to look inpublic void addToSelection(java.awt.Rectangle rect)
rect
- The rectange of data itemspublic void removeFromSelection(java.awt.Rectangle rect)
rect
- The rectange of data itemsprotected java.util.Collection getRectContents(java.awt.Rectangle rect)
rect
- The rectanglepublic void setColorField(java.lang.String field)
public void setColorScheme(java.lang.String color)
public void setSelectedColumn(java.lang.String colName)
colName
- The name of the column which is selectedpublic long getDelay()
public void setDelay(long delay)
delay
- The new delay valuepublic void reset()
public void setScale(double scaleX, double scaleY)
scale
- The new scale valuepublic void setScaleX(double scaleX)
scaleX
- The new x scale valuepublic void setScaleY(double scaleY)
scaleY
- The new y scale valuepublic double getScaleX()
public double getScaleY()
public double getOffsetX()
public double getOffsetY()
public void setOffsetX(double offsetX)
public void setOffsetY(double offsetY)
public java.awt.Point getOrigin()
public void selectionChanged(SelectionHandler select)
select
- The selection handler that created the selection changedpublic java.util.Collection getSelection()
public java.util.Collection getDeselection()
public void selectAll()
public void selectNone()
public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
event
- The mouse event that caused this tool tip to be displayedpublic java.awt.Point getToolTipLocation(java.awt.event.MouseEvent event)
event
- The mouse event that caused this to be calledpublic void setRect(java.awt.Rectangle r)
r
- The rectangle
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |