|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbibliothek.gui.dock.util.SimpleDockElementRepresentative
public class SimpleDockElementRepresentative
A very simplistic implementation of DockElementRepresentative, it just adds
a listener to a Component.
| Constructor Summary | |
|---|---|
SimpleDockElementRepresentative(DockElement element,
java.awt.Component component)
Creates a new SimpleDockElementRepresentative. |
|
| Method Summary | |
|---|---|
void |
addMouseInputListener(javax.swing.event.MouseInputListener listener)
Adds a listener to this representative, it is not defined what to do with that listener, but most subclasses would just add the listener to their component. |
java.awt.Component |
getComponent()
Gets the Component which represents the element. |
DockElement |
getElement()
Gets the element which is represented by this. |
java.awt.Point |
getPopupLocation(java.awt.Point click,
boolean popupTrigger)
Tells whether a popup menu should be opened when the user clicks at click with the mouse. |
boolean |
isUsedAsTitle()
Tells whether this DockElementRepresentative is used as title. |
void |
removeMouseInputListener(javax.swing.event.MouseInputListener listener)
Removes a listener from this representative. |
boolean |
shouldFocus()
Tells whether a click onto this component should transfer the focus either to this component or to the Dockable. |
boolean |
shouldTransfersFocus()
Tells whether a click onto this component should transfer the focus to the Dockable or not. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleDockElementRepresentative(DockElement element,
java.awt.Component component)
SimpleDockElementRepresentative.
element - the element which is represented by thiscomponent - the component to which this adds listeners| Method Detail |
|---|
public void addMouseInputListener(javax.swing.event.MouseInputListener listener)
DockElementRepresentativecomponent. It is valid to do nothing.
addMouseInputListener in interface DockElementRepresentativelistener - the new listenerpublic java.awt.Component getComponent()
DockElementRepresentativeComponent which represents the element.
The result of this method must not change.
getComponent in interface DockElementRepresentativenullpublic DockElement getElement()
DockElementRepresentativethis.
The result of this method must not change.
getElement in interface DockElementRepresentativenull
public java.awt.Point getPopupLocation(java.awt.Point click,
boolean popupTrigger)
DockElementRepresentativeclick with the mouse. If yes, then the top left edge
of the popup should be returned, otherwise null should be
returned.
getPopupLocation in interface DockElementRepresentativeclick - the location where the user clicked with the mousepopupTrigger - whether the invocation is the systems popup trigger
or not. Many implementations of this method will return click
in case of true, and null in case of false
null if no
popup-menu should be openedpublic boolean isUsedAsTitle()
DockElementRepresentativeDockElementRepresentative is used as title.DockRelocator can allow drag & drop only for titles.Dockable should have only one element that is a title,
so if in doubt return false.
isUsedAsTitle in interface DockElementRepresentativetrue if this representative should be seen as titlepublic boolean shouldFocus()
DockElementRepresentativeDockable.
shouldFocus in interface DockElementRepresentativetrue if clicking this component should influence focuspublic boolean shouldTransfersFocus()
DockElementRepresentativeDockable or not. If this
object is a Dockable, then a result of true might change the currently focused item
of itself. This property is ignored if DockElementRepresentative.shouldFocus() returns false.
shouldTransfersFocus in interface DockElementRepresentativepublic void removeMouseInputListener(javax.swing.event.MouseInputListener listener)
DockElementRepresentative
removeMouseInputListener in interface DockElementRepresentativelistener - the listener to remove
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||