Package ca.cgjennings.apps.arkham
Class RegionPicker.RegionChooser
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- ca.cgjennings.apps.arkham.RegionPicker.RegionChooser
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
- Enclosing class:
- RegionPicker
public static class RegionPicker.RegionChooser extends javax.swing.JComponent
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description java.awt.Rectangle[]
highlightRegions
static int
LOC_DRAG
static int
LOC_INSIDE
static int
LOC_OUTSIDE
java.awt.image.BufferedImage
overlay
java.awt.image.BufferedImage
regionImage
static java.lang.String
ZOOM_CHANGED_PROPERTY
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description RegionChooser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRegionChangeListener(RegionPicker.RegionChangeListener li)
void
copy()
Copy the current region to the clipboard as a string.protected void
fireRegionChanged()
java.awt.Cursor
getCursor()
java.awt.Color
getHighlightColor()
java.awt.Rectangle[]
getHighlightRegions()
java.awt.image.BufferedImage
getImage()
int
getLocationType(java.awt.Point p)
java.awt.image.BufferedImage
getOverlayImage()
PageShape
getPageShape()
java.awt.Color
getPageShapeColor()
java.awt.Rectangle
getRegion()
java.awt.Color
getRegionColor()
java.awt.image.BufferedImage
getRegionImage()
int
getZoom()
boolean
isClickToDefineEnabled()
boolean
isResizable()
boolean
isRestrictedRegion()
java.awt.Point
modelToView(java.awt.Point p, java.awt.Point dest)
java.awt.Rectangle
modelToView(java.awt.Rectangle r, java.awt.Rectangle dest)
protected void
paintComponent(java.awt.Graphics g1)
void
paste()
Parse a region from the current clipboard text and, if valid, set this editor to that region.void
removeRegionChangeListener(RegionPicker.RegionChangeListener li)
void
scrollRectToSelection()
void
setClickToDefineEnabled(boolean clickToDefineEnabled)
void
setHighlightColor(java.awt.Color c)
void
setHighlightRegions(java.awt.Rectangle[] highlightRegions)
Sets an array of additional regions that are relevant but not the region being edited.void
setImage(java.awt.image.BufferedImage image)
void
setOverlayImage(java.awt.image.BufferedImage overlay)
void
setPageShape(PageShape shape)
void
setPageShapeColor(java.awt.Color c)
void
setRegion(java.awt.Rectangle region)
void
setRegionColor(java.awt.Color c)
void
setRegionImage(java.awt.image.BufferedImage region)
void
setResizable(boolean resizable)
void
setRestrictedRegion(boolean restrictedRegion)
void
setZoom(int zoom)
java.awt.Point
viewToModel(java.awt.Point p, java.awt.Point dest)
-
Methods inherited from class javax.swing.JComponent
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, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, updateUI
-
Methods inherited from class java.awt.Container
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
-
Methods inherited from class java.awt.Component
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, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
LOC_OUTSIDE
public static final int LOC_OUTSIDE
- See Also:
- Constant Field Values
-
LOC_INSIDE
public static final int LOC_INSIDE
- See Also:
- Constant Field Values
-
LOC_DRAG
public static final int LOC_DRAG
- See Also:
- Constant Field Values
-
highlightRegions
public java.awt.Rectangle[] highlightRegions
-
overlay
public java.awt.image.BufferedImage overlay
-
regionImage
public java.awt.image.BufferedImage regionImage
-
ZOOM_CHANGED_PROPERTY
public static final java.lang.String ZOOM_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLocationType
public int getLocationType(java.awt.Point p)
-
scrollRectToSelection
public void scrollRectToSelection()
-
getCursor
public java.awt.Cursor getCursor()
- Overrides:
getCursor
in classjava.awt.Component
-
getImage
public java.awt.image.BufferedImage getImage()
-
setImage
public void setImage(java.awt.image.BufferedImage image)
-
getRegion
public java.awt.Rectangle getRegion()
-
setRegion
public void setRegion(java.awt.Rectangle region)
-
getZoom
public int getZoom()
-
setZoom
public void setZoom(int zoom)
-
paintComponent
protected void paintComponent(java.awt.Graphics g1)
- Overrides:
paintComponent
in classjavax.swing.JComponent
-
setRegionColor
public void setRegionColor(java.awt.Color c)
-
getRegionColor
public java.awt.Color getRegionColor()
-
setHighlightColor
public void setHighlightColor(java.awt.Color c)
-
getHighlightColor
public java.awt.Color getHighlightColor()
-
setPageShapeColor
public void setPageShapeColor(java.awt.Color c)
-
getPageShapeColor
public java.awt.Color getPageShapeColor()
-
getHighlightRegions
public java.awt.Rectangle[] getHighlightRegions()
-
setHighlightRegions
public void setHighlightRegions(java.awt.Rectangle[] highlightRegions)
Sets an array of additional regions that are relevant but not the region being edited. These are shown in another colour for reference.- Parameters:
highlightRegions
-
-
setOverlayImage
public void setOverlayImage(java.awt.image.BufferedImage overlay)
-
getOverlayImage
public java.awt.image.BufferedImage getOverlayImage()
-
setRegionImage
public void setRegionImage(java.awt.image.BufferedImage region)
-
getRegionImage
public java.awt.image.BufferedImage getRegionImage()
-
viewToModel
public java.awt.Point viewToModel(java.awt.Point p, java.awt.Point dest)
-
modelToView
public java.awt.Point modelToView(java.awt.Point p, java.awt.Point dest)
-
modelToView
public java.awt.Rectangle modelToView(java.awt.Rectangle r, java.awt.Rectangle dest)
-
addRegionChangeListener
public void addRegionChangeListener(RegionPicker.RegionChangeListener li)
-
removeRegionChangeListener
public void removeRegionChangeListener(RegionPicker.RegionChangeListener li)
-
fireRegionChanged
protected void fireRegionChanged()
-
copy
public void copy()
Copy the current region to the clipboard as a string.
-
paste
public void paste()
Parse a region from the current clipboard text and, if valid, set this editor to that region.
-
isRestrictedRegion
public boolean isRestrictedRegion()
-
setRestrictedRegion
public void setRestrictedRegion(boolean restrictedRegion)
-
isResizable
public boolean isResizable()
-
setResizable
public void setResizable(boolean resizable)
-
isClickToDefineEnabled
public boolean isClickToDefineEnabled()
-
setClickToDefineEnabled
public void setClickToDefineEnabled(boolean clickToDefineEnabled)
-
getPageShape
public PageShape getPageShape()
- Returns:
- the shape
-
setPageShape
public void setPageShape(PageShape shape)
- Parameters:
shape
- the shape to set
-
-