Package adams.gui.visualization.trail
Class TrailPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.visualization.trail.TrailPanel
-
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible
public class TrailPanel extends adams.gui.core.BasePanelPanel for displaying a single trail.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.gui.core.BaseTabbedPanem_LogTabbedPanethe tabbed pane for image/report and log.protected TrailViewerPanelm_Ownerthe owner.protected adams.gui.core.BaseLogPanelm_PanelLogthe log panel.protected static adams.core.Propertiesm_Propertiesthe setup for the panel.protected AbstractTrailReaderm_Readerthe reader that was used for reading in the trail.protected adams.gui.visualization.report.ReportFactory.Tablem_ReportTablethe report of the trail.protected adams.gui.core.SearchPanelm_SearchPanelthe search panel for the trail report.protected adams.gui.core.BaseSplitPanem_SplitPanethe split pane for image/spreadsheet and report.protected adams.gui.core.BaseTabbedPanem_TabbedPanethe tabbed pane for the image and spreadsheet view.protected Trailm_Trailthe trail on display.protected adams.gui.visualization.image.ImagePanelm_TrailImagethe panel for displaying the trail as image.protected TrailPaintletm_TrailPaintletthe default paintlet.protected adams.gui.core.SpreadSheetTablem_TrailTablethe table with the trail as spreadsheet.-
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
Constructors Constructor Description TrailPanel(TrailViewerPanel owner)Initializes the panel.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOverlay(AbstractTrailOverlay overlay)Adds the trail overlay.booleancanReload()Checks whether this panel can be reloaded.adams.gui.visualization.image.ImagePanelgetImagePanel()Returns the underlying image panelTrailViewerPanelgetOwner()Returns the owner of this panel.TrailPaintletgetPaintlet()Returns the current paintlet in use.static adams.core.PropertiesgetProperties()Returns the properties for this panel.AbstractTrailReadergetReader()Returns the trail reader that was used for loading this trail.StringgetTitle()Returns the database ID or filename as title.TrailgetTrail()The current trail on display.doublegetZoom()Returns the zoom factor (0-16).protected voidinitGUI()Initializes the widgets.protected voidinitialize()Initializes the members.booleanisSearchPanelVisible()Returns whether the search panel is visible.voidlog(String msg)Logs the message in the log panel.protected Stringrefresh()Regenerates the image of the current trail and redisplays it.booleanreload()Reloads the data, if possible.voidremoveOverlays()Removes all overlays.voidsearch(String text, boolean isRegExp)Performs a search.voidsetPaintlet(TrailPaintlet value)Sets the paintlet to use.voidsetReader(AbstractTrailReader value)Sets the trail reader that was used for loading this trail.voidsetSearchPanelVisible(boolean value)Sets whether to display the search panel or not.voidsetTrail(Trail value)Sets the trail to display.voidsetZoom(double zoom)Sets the zoom factor (0-16).-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, finishInit, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, main, printErrorMessage, printException, saveComponent, setEnabledCascade, setEnabledCascade, setParentTitle, setVisible
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
m_Properties
protected static adams.core.Properties m_Properties
the setup for the panel.
-
m_Trail
protected Trail m_Trail
the trail on display.
-
m_TrailImage
protected adams.gui.visualization.image.ImagePanel m_TrailImage
the panel for displaying the trail as image.
-
m_TrailTable
protected adams.gui.core.SpreadSheetTable m_TrailTable
the table with the trail as spreadsheet.
-
m_ReportTable
protected adams.gui.visualization.report.ReportFactory.Table m_ReportTable
the report of the trail.
-
m_SearchPanel
protected adams.gui.core.SearchPanel m_SearchPanel
the search panel for the trail report.
-
m_LogTabbedPane
protected adams.gui.core.BaseTabbedPane m_LogTabbedPane
the tabbed pane for image/report and log.
-
m_SplitPane
protected adams.gui.core.BaseSplitPane m_SplitPane
the split pane for image/spreadsheet and report.
-
m_TabbedPane
protected adams.gui.core.BaseTabbedPane m_TabbedPane
the tabbed pane for the image and spreadsheet view.
-
m_Owner
protected TrailViewerPanel m_Owner
the owner.
-
m_Reader
protected AbstractTrailReader m_Reader
the reader that was used for reading in the trail.
-
m_PanelLog
protected adams.gui.core.BaseLogPanel m_PanelLog
the log panel.
-
m_TrailPaintlet
protected TrailPaintlet m_TrailPaintlet
the default paintlet.
-
-
Constructor Detail
-
TrailPanel
public TrailPanel(TrailViewerPanel owner)
Initializes the panel.- Parameters:
owner- the owner of this panel
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classadams.gui.core.BasePanel
-
initGUI
protected void initGUI()
Initializes the widgets.- Overrides:
initGUIin classadams.gui.core.BasePanel
-
getOwner
public TrailViewerPanel getOwner()
Returns the owner of this panel.- Returns:
- the owner, null if none set
-
setPaintlet
public void setPaintlet(TrailPaintlet value)
Sets the paintlet to use.- Parameters:
value- the paintlet
-
getPaintlet
public TrailPaintlet getPaintlet()
Returns the current paintlet in use.- Returns:
- the paintlet
-
refresh
protected String refresh()
Regenerates the image of the current trail and redisplays it.- Returns:
- null if everything OK, otherwiser error message
-
setTrail
public void setTrail(Trail value)
Sets the trail to display.- Parameters:
value- the trail to display
-
getTrail
public Trail getTrail()
The current trail on display.- Returns:
- the trail on display
-
setReader
public void setReader(AbstractTrailReader value)
Sets the trail reader that was used for loading this trail. Used for reloading.- Parameters:
value- the reader
-
getReader
public AbstractTrailReader getReader()
Returns the trail reader that was used for loading this trail.- Returns:
- the reader, null if loaded from database
-
addOverlay
public void addOverlay(AbstractTrailOverlay overlay)
Adds the trail overlay.- Parameters:
overlay- the overlay to add
-
removeOverlays
public void removeOverlays()
Removes all overlays.
-
getTitle
public String getTitle()
Returns the database ID or filename as title.- Returns:
- the title
-
getImagePanel
public adams.gui.visualization.image.ImagePanel getImagePanel()
Returns the underlying image panel- Returns:
- the panel
-
canReload
public boolean canReload()
Checks whether this panel can be reloaded.- Returns:
- true if reload is possible
-
reload
public boolean reload()
Reloads the data, if possible.- Returns:
- true if successfully reloaded
-
search
public void search(String text, boolean isRegExp)
Performs a search.- Parameters:
text- the search textisRegExp- whether the search text is a regular expression
-
setSearchPanelVisible
public void setSearchPanelVisible(boolean value)
Sets whether to display the search panel or not.- Parameters:
value- if true then the search panel is displayed
-
isSearchPanelVisible
public boolean isSearchPanelVisible()
Returns whether the search panel is visible.- Returns:
- true if the search panel is visible
-
getProperties
public static adams.core.Properties getProperties()
Returns the properties for this panel.- Returns:
- the properties file for this panel
-
setZoom
public void setZoom(double zoom)
Sets the zoom factor (0-16). Use -1 to fit inside panel.- Parameters:
zoom- the zoom factor
-
getZoom
public double getZoom()
Returns the zoom factor (0-16).- Returns:
- the zoom factor
-
log
public void log(String msg)
Logs the message in the log panel.- Parameters:
msg- the log message
-
-