java.lang.Object
org.jpo.gui.ThumbnailDescriptionController
- All Implemented Interfaces:
GroupInfoChangeListener,PictureInfoChangeListener
public class ThumbnailDescriptionController
extends Object
implements PictureInfoChangeListener, GroupInfoChangeListener
ThumbnailDescriptionJPanel is a JPanel that displays the metadata of a
thumbnail. It knows the node it is representing. It can be told to change the
node it is showing. It can be mute. It knows it's x and y position in the
grid
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumchoices for the Description size -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SortableDefaultMutableTreeNodea link to the SortableDefaultMutableTreeNode in the data model. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<JPopupMenu>correctTextPopupMenu(@NonNull String text, @NonNull JTextArea textArea) Returns a popup menu if there are some text patterns that JPO knows how to clean upvoiddoUpdate()doUpdate writes the changed text back to the data model and submits an nodeChanged notification on the model.voidThis method formats the text information fields for the indicated node.getNode()returns the current nodegetPanel()Returns the preferred size for the ThumbnailDescription as a Dimension using the thumbnailSize as width and height.voidgroupInfoChangeEvent(GroupInfoChangeEvent groupInfoChangeEvent) inform the listener that the GroupInfo has changedvoidvoidpictureInfoChangeEvent(PictureInfoChangeEvent pictureInfoChangeEvent) here we get notified by the PictureInfo object that something has changed.voidThis method how the description panel is shown.voidsetFactor(float thumbnailSizeFactor) This method sets the scaling factor for the display of a thumbnail descriptionvoidsetNode(SortableDefaultMutableTreeNode referringNode) This method sets the node which the ThumbnailDescriptionJPanel should display.voidsetVisible(boolean visibility) Overridden method to allow the better tuning of visibilityvoidshowFilename(boolean showFilename) Makes the filename visible or hidden depending on the supplied parameter.voidchanges the colour so that the user sees whether the thumbnail is part of the selection
-
Field Details
-
referringNode
a link to the SortableDefaultMutableTreeNode in the data model. This allows thumbnails to be selected by sending a nodeSelected event to the data model.
-
-
Constructor Details
-
ThumbnailDescriptionController
public ThumbnailDescriptionController()Construct a new ThumbnailDescriptionJPanel
-
-
Method Details
-
correctTextPopupMenu
public static Optional<JPopupMenu> correctTextPopupMenu(@NonNull String text, @NonNull JTextArea textArea) Returns a popup menu if there are some text patterns that JPO knows how to clean up- Parameters:
text- The text to clean uptextArea- The widget upon which to open to popup menu- Returns:
- an optional pop up menu
-
getPanel
-
handleCollectionLockNotification
-
doUpdate
public void doUpdate()doUpdate writes the changed text back to the data model and submits an nodeChanged notification on the model. It gets called by the Inputverifier on the text area. -
getDescription
-
getFileLocation
-
setDisplayMode
This method how the description panel is shown. It can be set to ThumbnailDescriptionJPanel.LARGE_DESCRIPTION, ThumbnailDescriptionJPanel.MINI_INFO,- Parameters:
displayMode- display Mode
-
formatDescription
public void formatDescription()This method formats the text information fields for the indicated node. -
setVisible
public void setVisible(boolean visibility) Overridden method to allow the better tuning of visibility- Parameters:
visibility- Send in true or false
-
showSelectionStatus
public void showSelectionStatus()changes the colour so that the user sees whether the thumbnail is part of the selection -
getPreferredSize
Returns the preferred size for the ThumbnailDescription as a Dimension using the thumbnailSize as width and height.- Returns:
- Returns the preferred size for the ThumbnailDescription as a Dimension using the thumbnailSize as width and height.
-
setFactor
public void setFactor(float thumbnailSizeFactor) This method sets the scaling factor for the display of a thumbnail description- Parameters:
thumbnailSizeFactor- Factor
-
getNode
returns the current node- Returns:
- the current node
-
setNode
This method sets the node which the ThumbnailDescriptionJPanel should display. If it should display nothing then set it to null.- Parameters:
referringNode- The Node to be displayed
-
pictureInfoChangeEvent
here we get notified by the PictureInfo object that something has changed.- Specified by:
pictureInfoChangeEventin interfacePictureInfoChangeListener- Parameters:
pictureInfoChangeEvent- the event object with details about what changed
-
groupInfoChangeEvent
Description copied from interface:GroupInfoChangeListenerinform the listener that the GroupInfo has changed- Specified by:
groupInfoChangeEventin interfaceGroupInfoChangeListener- Parameters:
groupInfoChangeEvent- The Change event
-
showFilename
public void showFilename(boolean showFilename) Makes the filename visible or hidden depending on the supplied parameter.- Parameters:
showFilename- send true to make it visible, false to hide it.
-