|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.levigo.jadice.demo.BasicJadicePanel
public class BasicJadicePanel
This class provides a convenience component to have an easy possibility for a comfortable page
view embedding. As a 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:
addSorterToolBar(String)
addSorterToolBar(SorterToolbar, String)
addRollingMessagePanel(String)
removeRollingMessagePanel()
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 | |
---|---|
protected JToolBar |
annoTools
|
protected JToolBar |
mainTools
|
protected JMenuBar |
menuBar
|
protected StatusBar |
snapInStatusBar
|
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 | |
---|---|
BasicJadicePanel()
Creates a new instance of a jadice panel. |
|
BasicJadicePanel(DefaultMenuComponentFactory menuComponentFactory)
Creates a new instance of a jadice panel. |
Method Summary | |
---|---|
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 Context |
createContext()
Initializes and fills the context with the embedded viewer (to perform operations regarding the display of the document) and a reference to the context itself. |
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 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. |
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. |
protected void |
initGui()
Initializes and arranges the gui components. |
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. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected StatusBar snapInStatusBar
protected JToolBar mainTools
protected JToolBar annoTools
protected JMenuBar menuBar
Constructor Detail |
---|
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 componentsMethod Detail |
---|
protected 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
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 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 constraints
NullPointerException
- 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 createContext()
This method will be called only once at the creation time of this object.
public BasicViewer getViewer()
BasicViewer
public PageView getPageView()
PageView
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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |