|
|||||||||
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 | +--jas.hist.JASHist
JASHist is the main component used for plotting histograms, scatterplots etc. The type of display produced depends on the DataSource hooked to the component. If the data source is observable, then the JASHist will update as it receives notifications from the data source. JASHist supports overlaying of data and fitting of functions (to 1D histograms).
Inner 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 | |
static int |
BEVEL_IN
|
static int |
BEVEL_OUT
|
static int |
ETCHED
|
static int |
LEGEND_ALWAYS
|
static int |
LEGEND_AUTOMATIC
|
static int |
LEGEND_NEVER
|
static int |
LINE
|
static int |
NONE
|
static int |
SHADOW
|
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 | |
JASHist()
Create a new JASHist component with no initial data source |
Method Summary | |
JASHistData |
addData(DataSource ds)
Add a DataSource to the plot. |
static void |
addFitListener(FitListener fitListener)
Add a FitListener that will receive notifications about the status of fits being performed by the plot |
void |
addNotify()
Overrides addNotify in JComponent |
void |
deselected()
|
void |
destroy()
Removes and detaches all data from the plot, but doesn't set up the plot for further use. |
void |
fillFunctionMenu(javax.swing.JMenu menu)
Fills the appropriate Function menu items into a user provided menu. |
void |
fillSliceMenu(javax.swing.JMenu menu)
Fills the appriate Slice/Projection menu items into a user provided menu. |
java.util.Enumeration |
get1DFunctions()
Get the set of Functions currently attached to the plot |
boolean |
getAllowUserInteraction()
Test if user direct user interaction with the plot is allowed |
java.awt.Color |
getBackground()
Get the background color. |
javax.swing.border.Border |
getDataAreaBorder()
|
int |
getDataAreaBorderType()
Get the current data area border type |
java.awt.Color |
getDataAreaColor()
Return the current data area background color |
java.util.Enumeration |
getDataSources()
Get the set of data sources currently attached to the plot. |
Legend |
getLegend()
|
int |
getNumberOfDataSources()
Get the number of data sources attached to the plot |
int |
getShowLegend()
Get the current setting of the showLegend property |
boolean |
getShowStatistics()
|
StatisticsBlock |
getStats()
|
java.lang.String |
getTitle()
Get the text of the title. |
Title |
getTitleObject()
Actually get the Title object. |
java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor flavor)
|
java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors()
|
JASHistAxis |
getXAxis()
Gets the X axis |
JASHistAxis[] |
getYAxes()
Get an array containing all of the Y Axes |
JASHistAxis |
getYAxis()
Gets the default Y Axis |
JASHistAxis |
getYAxis(int index)
Gets either Y Axis. |
boolean |
isChanged()
|
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
|
void |
mouseEventNotify(java.awt.event.MouseEvent e)
|
void |
readExternal(java.io.ObjectInput p)
|
void |
removeAllData()
Removes and detaches all data and sets up the plot for further use. |
void |
saveAs()
Pops up a dialog asking the user to choose a file/format to save the plot. |
void |
setAllowUserInteraction(boolean allow)
Controls whether end users are allowed to directly interact with the plot by way of popup menus or "clicking and dragging". |
void |
setBackground(java.awt.Color c)
Set the color used to paint the background (but not the data area) |
void |
setDataAreaBorder(javax.swing.border.Border b)
|
void |
setDataAreaBorderType(int type)
Set the border to place around the data area |
void |
setDataAreaColor(java.awt.Color c)
Set the color used to paint the background of the data area |
void |
setForegroundColor(java.awt.Color c)
Sets the current foreground color, used by default as the color for the axis, labels, title, legend etc. |
void |
setLegend(Legend newLegend)
|
void |
setShowLegend(int legend)
Set when the legend will be shown. |
void |
setShowStatistics(boolean show)
|
void |
setStats(StatisticsBlock newStats)
|
void |
setTitle(java.lang.String newValue)
Set the text of the title |
void |
setTitleObject(Title newTitle)
Actually set the Title object. |
void |
showProperties()
Pops up the Properties dialog box for this plot |
void |
showProperties(byte axis)
Pops up the properties dialog box for this plot with the specified axis tab initially open |
boolean |
supportsProperties()
|
void |
writeExternal(java.io.ObjectOutput p)
|
void |
writeXML(java.io.Writer w,
boolean snapshot)
Writes the histogram, scatterplot etc that we are displaying as XML. |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addPropertyChangeListener, 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, getPreferredSize, 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, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, 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, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, 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, 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 |
public static final int NONE
public static final int BEVEL_IN
public static final int BEVEL_OUT
public static final int ETCHED
public static final int LINE
public static final int SHADOW
public static final int LEGEND_NEVER
public static final int LEGEND_AUTOMATIC
public static final int LEGEND_ALWAYS
Constructor Detail |
public JASHist()
Method Detail |
public boolean supportsProperties()
showProperties()
public void showProperties()
showProperties(byte)
public void showProperties(byte axis)
axis
- The axis tab to opened (defined??)showProperties()
public void addNotify()
addNotify
in class javax.swing.JComponent
public void writeXML(java.io.Writer w, boolean snapshot)
pw
- A PrintWriter to send the output tosnapshot
- A snapshot of the current data is stored if true, otherwise a reference to the datasourcepublic void writeExternal(java.io.ObjectOutput p) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
public void readExternal(java.io.ObjectInput p) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
public boolean getAllowUserInteraction()
setAllowUserInteraction(boolean)
public void setAllowUserInteraction(boolean allow)
allow
- True if user interactions are to be allowed.public void setShowStatistics(boolean show)
public boolean getShowStatistics()
public void setBackground(java.awt.Color c)
setBackground
in class javax.swing.JComponent
c
- The new Color to use, or null
to set the background to be transparentsetDataAreaColor(Color)
,
setForegroundColor(Color)
public java.awt.Color getBackground()
getBackground
in class java.awt.Component
public void setForegroundColor(java.awt.Color c)
c
- The new foreground colorpublic java.awt.Color getDataAreaColor()
setDataAreaColor(Color)
public void setDataAreaColor(java.awt.Color c)
c
- The new color to be used to paint the data area background, or null
`to set the bacground back to the default valuesetBackground(Color)
,
JComponent.setForeground(Color)
public void setDataAreaBorderType(int type)
type
- One of NONE,BEVEL_IN,BEVEL_OUT,ETCHED,LINE,SHADOWpublic int getDataAreaBorderType()
public void setDataAreaBorder(javax.swing.border.Border b)
public javax.swing.border.Border getDataAreaBorder()
public JASHistAxis getXAxis()
public JASHistAxis getYAxis()
getYAxis(int)
public JASHistAxis getYAxis(int index)
index
- The axis to get, 0 = left (default), 1 = rightpublic JASHistAxis[] getYAxes()
public void setShowLegend(int legend)
legend
- One of LEGEND_NEVER,LEGEND_AUTOMATIC,LEGEND_ALWAYSpublic int getShowLegend()
setShowLegend(int)
public JASHistData addData(DataSource ds) throws jas.hist.DataManagerException
ds
- The DataSource to addjas.hist.DataManagerException
- If the subclass of DataSource is unrecognized or if the new DataSource is incompatible with previously added DataSources.public java.util.Enumeration getDataSources()
Enumeration e = hPlot.getDataSources(); while (e.hasMoreElements()) { JASHistData data = (JASHistData) e.nextElement(); DataSource source = data.getDataSource(); }
JASHistData
,
JASHistData.getDataSource()
public int getNumberOfDataSources()
public java.util.Enumeration get1DFunctions()
public void destroy()
public void removeAllData()
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors
in interface java.awt.datatransfer.Transferable
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
isDataFlavorSupported
in interface java.awt.datatransfer.Transferable
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
getTransferData
in interface java.awt.datatransfer.Transferable
public void fillFunctionMenu(javax.swing.JMenu menu)
menu
- The menu to which the items will be addedpublic void fillSliceMenu(javax.swing.JMenu menu)
menu
- The menu to which the items will be addedpublic java.lang.String getTitle()
getTitleObject()
public Title getTitleObject()
public void setTitleObject(Title newTitle)
newTitle
- The new title objectpublic void setTitle(java.lang.String newValue)
newValue
- pass null
to remove the titlepublic boolean isChanged()
public static void addFitListener(FitListener fitListener)
fitListener
- The FitListener to addpublic void mouseEventNotify(java.awt.event.MouseEvent e)
mouseEventNotify
in interface JASPlotMouseListener
public void deselected()
public StatisticsBlock getStats()
public void setStats(StatisticsBlock newStats)
public Legend getLegend()
public void setLegend(Legend newLegend)
public void saveAs() throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |