public class BasicJadicePanel extends JPanel implements JadiceToolbarProvider
JPanel
it can be easily embedded in different component hierarchies
and layouts. Developers just have to implement the following methods to customise the panel's
appearance:
Specific additional components can be added or removed via calls of
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected JToolBar |
annoTools |
protected JToolBar |
mainTools |
protected JMenuBar |
menuBar |
protected StatusBar |
snapInStatusBar |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
BasicJadicePanel()
Creates a new instance of a jadice panel.
|
BasicJadicePanel(DefaultMenuComponentFactory menuComponentFactory)
Creates a new instance of a jadice panel.
|
Modifier and Type | Method and Description |
---|---|
MessageWidget |
addRollingMessagePanel(String constraint)
Adds a rolling message and info panel to this container.
|
void |
addSorterToolBar(SorterToolbar sorterToolbar,
String borderLayoutConstraint)
Adds a given sorter toolbar to this panel.
|
void |
addSorterToolBar(String borderLayoutConstraint)
Adds a default sorter toolbar associated to contained viewer to this panel.
|
protected JToolBar |
createJadiceAnnotationToolbar()
Creates and returns the annotation toolbar.
|
protected JToolBar |
createJadiceMainToolBar()
Creates and returns the application's toolbar.
|
protected JMenuBar |
createJadiceMenuBar()
Creates and returns the applications menubar.
|
protected JPanel |
createOptionalGroupPanel()
Creates and returns the optional group toolbar.
|
protected StatusBar |
createSnapInStatusBar()
Creates and returns the embedded status bar.
|
protected BasicViewer |
createViewer()
Create the viewer instance.
|
static String |
getAnnotationToolBarLocation()
Returns the layout constraint of the annotation toolbar.
|
Context |
getContext()
Returns the main context.
|
JToolBar |
getJadiceAnnotationToolbar()
Returns a reference to the applications annotation toolbar.
|
JToolBar |
getJadiceMainToolBar()
Returns a reference to the main toolbar.
|
JMenuBar |
getJadiceMenuBar()
Returns a reference to the current applications menu bar.
|
static String |
getMainToolBarLocation()
Returns the layout constraint of the main toolbar.
|
DefaultMenuComponentFactory |
getMenucomponentsFactory()
Returns the MenuComponentFactory this panel was created with.
|
JPanel |
getOptionalGroupPanel()
Returns a reference to the current optional group panel.
|
PageView |
getPageView()
Returns the embedded page viewer.
|
MessageWidget |
getRollingMessagePanel()
Returns a reference to the contained rolling message and info panel.
|
StatusBar |
getSnapInStatusBar()
Returns a reference to embedded snap-in status bar.
|
SorterToolbar |
getSorterToolbar()
Returns a reference to the contained sorter toolbar object if available.
|
BasicViewer |
getViewer()
Returns the embedded viewer instance.
|
void |
hideFileOverviewPanel()
Hides the
FileOverviewPanel . |
protected void |
initGui()
Initializes and arranges the gui components.
|
protected Context |
initializeContext()
Creates and installs the context for this component.
|
protected Context |
installContext()
Creates and installs the context for this component.
|
void |
removeRollingMessagePanel()
Removes the rolling message and info panel from this container.
|
static void |
setAnnotationToolBarLocation(String constraint)
Sets the layout constraint of the annotation toolbar.
|
static void |
setMainToolBarLocation(String constraint)
Sets the layout constraint of the main jadice toolbar.
|
void |
showFileOverviewPanel()
Shows the
FileOverviewPanel . |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, setVisible, unregisterKeyboardAction, update
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
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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected StatusBar snapInStatusBar
protected JToolBar mainTools
protected JToolBar annoTools
protected JMenuBar menuBar
public BasicJadicePanel()
It initializes and layouts the embedded components like the viewer, the status bar and so on. The
layout and composition of the embedded gui components will be done in the method
initGui()
, which is called within this constructor. Furthermore a Context
object
will be created, to serve as context state representation for associated CommandAction
s.
This constructor will call BasicJadicePanel(DefaultMenuComponentFactory)
with the
factory
DefaultMenuComponentFactory.getInstance( LauncherConstants.DEFAULT_MENU_COMPONENTS_PROPERTIES_FILE
)
public BasicJadicePanel(DefaultMenuComponentFactory menuComponentFactory)
It initializes and layouts the embedded components like the viewer, the status bar and so on. The
layout and composition of the embedded gui components will be done in the method
initGui()
, which is called within this constructor. Furthermore a Context
object
will be created, to serve as context state representation for associated CommandAction
s.
menuComponentFactory
- - the factory to create the GUI componentsprotected JMenuBar createJadiceMenuBar()
The created menu bar uses the menu structure definition jadiceMenubar defined in the menucomponents configuration in com.levigo.jadice.resources.properties package. If this structure could not be instantiated, a default menubar with the following menu structures will be created:
Hint:
This method does not change the component hierarchy. Removing old instances and adding new
instances to the component hierarchy is up to the developer.
public JMenuBar getJadiceMenuBar()
public JToolBar getJadiceMainToolBar()
getJadiceMainToolBar
in interface JadiceToolbarProvider
public JPanel getOptionalGroupPanel()
protected JToolBar createJadiceMainToolBar()
The created toolbar uses the menu structure definition jadiceToolbar defined in the
menucomponents configuration (menucomponents.properties
) in
com.levigo.jadice.demo.resources
package.
Hint:
This method does not change the component hierarchy. Removing old instances and adding new
instances to the component hierarchy is up to the developer.
JToolBar
public JToolBar getJadiceAnnotationToolbar()
getJadiceAnnotationToolbar
in interface JadiceToolbarProvider
protected JToolBar createJadiceAnnotationToolbar()
The created toolbar uses the menu structure definition
<annotationTypePrefix>
-annotations defined in the menucomponents configuration
in com.levigo.jadice.resources.properties package.
Hint:
This method does not change the component hierarchy. Removing old instances and adding new
instances to the component hierarchy is up to the developer.
JToolBar
protected JPanel createOptionalGroupPanel()
JPanel
protected BasicViewer createViewer()
protected void initGui()
public MessageWidget addRollingMessagePanel(String constraint)
BorderLayout.NORTH
- for the top of the containerBorderLayout.SOUTH
- for the bottom of the containerIllegalArgumentException
will be thrown.
This method changes the component hierarchy of swing components. Therefore it is strongly recommended that this method must be called on on the event dispatching thread. This is necessary because Swing objects and methods are generally not thread safe; invoking them from multiple threads risks thread interference or memory consistency errors.
constraint
- describes the position where the message panel should placed in the containers
layout. Accepted values are BorderLayout.NORTH
and BorderLayout.SOUTH
.RollingMessagePanel
IllegalArgumentException
- if the constraint is none of the allowed constraintsNullPointerException
- if the constraint is null
public void removeRollingMessagePanel()
This method changes the component hierarchy of swing components. Therefore it is strongly recommended that this method must be called on on the event dispatching thread. This is necessary because Swing objects and methods are generally not thread safe; invoking them from multiple threads risks thread interference or memory consistency errors.
public MessageWidget getRollingMessagePanel()
null
.null
if no message panel is
contained.public void addSorterToolBar(String borderLayoutConstraint)
This method changes the component hierarchy of swing components. Therefore it must be called on on the event dispatching thread. This is necessary because Swing objects and methods are generally not thread safe; invoking them from multiple threads risks thread interference or memory consistency errors.
borderLayoutConstraint
- the layout constraint, allowed values are
BorderLayout.NORTH
,BorderLayout.SOUTH
, BorderLayout.EAST
,
BorderLayout.WEST
.IllegalArgumentException
- Any other constraint values as the named above will cause an
IllegalArgumentException
.public void addSorterToolBar(SorterToolbar sorterToolbar, String borderLayoutConstraint)
This method changes the component hierarchy of swing components. Therefore it must be called on on the event dispatching thread. This is necessary because Swing objects and methods are generally not thread safe; invoking them from multiple threads risks thread interference or memory consistency errors.
sorterToolbar
- the sorter toolbar to addborderLayoutConstraint
- the layout constraint, allowed values are
BorderLayout.NORTH
,BorderLayout.SOUTH
, BorderLayout.EAST
,
BorderLayout.WEST
.IllegalArgumentException
- Any other constraint value as the named above will cause an
IllegalArgumentException
.NullPointerException
- if the given sorter toolbar is null
public Context getContext()
protected Context initializeContext()
Context.Children.ACTIVE
and
Context.Ancestors.ALL
.protected Context installContext()
public BasicViewer getViewer()
BasicViewer
public static String getAnnotationToolBarLocation()
This constraint describe the layout position of the annotation toolbar when an instance of this class is newly created.
BorderLayout.NORTH
- for the top of the containerBorderLayout.SOUTH
- for the bottom of the containerBorderLayout.WEST
- for the left side of the containerBorderLayout.EAST
- for the right side of the containerpublic static void setAnnotationToolBarLocation(String constraint)
Allowed constraints are
BorderLayout.NORTH
- for the top of the containerBorderLayout.SOUTH
- for the bottom of the containerBorderLayout.WEST
- for the left side of the containerBorderLayout.EAST
- for the right side of the container
Hint:
It is upon the developer to take care, that annotation and main toolbar does not have the same
constraint.
constraint
- layout position of the annotation toolbar for new created instances of this
classpublic static String getMainToolBarLocation()
This constraint describe the layout position of the main toolbar when an instance of this class is newly created.
BorderLayout.NORTH
- for the top of the containerBorderLayout.SOUTH
- for the bottom of the containerBorderLayout.WEST
- for the left side of the containerBorderLayout.EAST
- for the right side of the containerpublic static void setMainToolBarLocation(String constraint)
Possible constraints are
BorderLayout.NORTH
- for the top of the containerBorderLayout.SOUTH
- for the bottom of the containerBorderLayout.WEST
- for the left side of the containerBorderLayout.EAST
- for the right side of the container
Hint:
It is upon the developer to take care, that annotation and main toolbar does not have the same
constraint.
constraint
- layout position of the main toolbar for new created instances of this classpublic SorterToolbar getSorterToolbar()
null
will be returned.SorterToolbar
public StatusBar getSnapInStatusBar()
protected StatusBar createSnapInStatusBar()
getSnapInStatusBar()
method.
This method should not change the component hierarchy. Removing old instances and adding new instances to the component hierarchy is up to the developer.
This method will be called only once at the creation time of this object.
StatusBar
public DefaultMenuComponentFactory getMenucomponentsFactory()
public void showFileOverviewPanel()
FileOverviewPanel
.public void hideFileOverviewPanel()
FileOverviewPanel
.Copyright © 2024 levigo holding gmbh. All rights reserved.