|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.nite.tools.videolabeler.ViewFrameFactory
public class ViewFrameFactory
A view frame factory is a global singleton object. Before it is used it
should be created with
ViewFrameFactory.createInstance()
.
From then on the same factory can be retrieved with
ViewFrameFactory.getInstance()
.
A view frame factory creates view frames for certain selected annotation
layers. A view frame is an instance of ViewFrame
. This
factory does not only create view frames, but it also serves as a repository
of the current view frames and it is responsible for laying out the view
frames in a designated area of a desktop pane.
The factory implements the SelectionListener
interface. The user should be able to select and deselect the layers for
which view frames should be shown. Whenever the user selects or deselects an
annotation layer, the method
layerSelected()
should be called, so that the view frame for the selected/deselected layer
is created/removed and the view frames are layed out on the desktop.
Method Summary | |
---|---|
void |
agentSelected(NAgent agent,
boolean selected)
This method does nothing, because view frames are only associated with a layer, not with an agent. |
static ViewFrameFactory |
createInstance(javax.swing.JDesktopPane desktop,
java.awt.Rectangle area)
Initialises the singleton view frame factory. |
static ViewFrameFactory |
getInstance()
Returns the singleton view frame factory. |
void |
layerSelected(AnnotationLayer layer,
boolean selected)
Selects or deselects a layer. |
void |
setArea(java.awt.Rectangle area)
Sets the area of the desktop in which the view frames are layed out. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ViewFrameFactory createInstance(javax.swing.JDesktopPane desktop, java.awt.Rectangle area)
Initialises the singleton view frame factory. The factory will display
the view frames on the specified desktop. The frames will be layed out in
the specified area of the desktop. The factory uses a
FrameArranger
to lay out the view frames.
If the singleton view frame factory has already been initialised, this method does not create a new factory, but simple returns the existing singleton factory.
desktop
- the desktop where the view frames will be displayedarea
- the area of the desktop in which the view frames will be
layed out
public static ViewFrameFactory getInstance()
Returns the singleton view frame factory. The factory should have been
initialised first with
createInstance
.
If the factory has not been initialised yet, this method returns
null.
public void setArea(java.awt.Rectangle area)
Sets the area of the desktop in which the view frames are layed out. This method will set the area and lay out the current view frames in the specified area.
area
- an area of the desktoppublic void agentSelected(NAgent agent, boolean selected)
This method does nothing, because view frames are only associated with a layer, not with an agent.
agentSelected
in interface SelectionListener
agent
- the agent that is selected or deselectedselected
- true if the agent is selected, false if it is deselectedpublic void layerSelected(AnnotationLayer layer, boolean selected)
Selects or deselects a layer. If a layer is selected, the view frame for that layer is created on the desktop. If a layer is deselected, the view frame for that layer is removed from the desktop. In either case the new set of selected view frames are layed out in the designated desktop area.
layerSelected
in interface SelectionListener
layer
- the layer that is selected or deselectedselected
- true if the layer is selected, false if it is deselected
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |