|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.freehep.swing.graphics.GraphicalSelectionPanel
org.freehep.swing.graphics.AbstractRegionSelectionPanel
org.freehep.swing.graphics.SquareSelectionPanel
public class SquareSelectionPanel
A panel which selects a "square" region on the screen. The definition of "square" is that this region will retain the relative scaling of the x and y-axes.
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.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class org.freehep.swing.graphics.AbstractRegionSelectionPanel |
---|
activeCtrlPt, ctrlPtSize, hitThreshold, lastDrawnRect, lastDrawnRectValid, nCtrlPts, NO_CONTROL_POINT, rectToDraw, updateRect, visible, visibleGuides, xCtrlPts, yCtrlPts |
Fields inherited from class org.freehep.swing.graphics.GraphicalSelectionPanel |
---|
actionMap, defaultModeAction, nextAction, previousAction, selectionActions, thickStroke, thinStroke |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, 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 | |
---|---|
SquareSelectionPanel()
Creates a SquareSelectionPanel. |
Method Summary | |
---|---|
Cursor |
getControlPointCursor(int index)
Returns the NE, SE, NW and SW cursors for the four different directions and SquareCursor as the default |
int |
getNumberOfControlPoints()
Return the number of control points,5---the four corners and one point in the center of the square. |
void |
initializeControlPoints(int x,
int y)
Initialize the control points based on the starting point (x,y). |
boolean |
isValidSelection()
Determine if the selection is valid; regions of zero area are considered invalid. |
AffineTransform |
makeAffineTransform()
Make the affine transform which corresponds to this "square" selection. |
void |
paintComponent(Graphics g)
Repaint this component. |
void |
updateActiveControlPoint(int x,
int y)
Move the active control point to the point (x,y). |
Methods inherited from class org.freehep.swing.graphics.AbstractRegionSelectionPanel |
---|
compassCursor, forceXCoordinateWithinBounds, forceYCoordinateWithinBounds, getVisibleGuides, keyReleased, makeOutlinePolygon, makeSelectionEvent, makeTransform, mouseDragged, mouseMoved, mousePressed, mouseReleased, moveActiveControlPoint, nearWhichControlPoint, repaintPanel, resetSelection, setVisibleGuides |
Methods inherited from class org.freehep.swing.graphics.GraphicalSelectionPanel |
---|
addActionEntry, addActionEntry, addGraphicalSelectionListener, cancelPopupProcessing, fireGraphicalSelectionMade, getBorder, getPopupMenu, isProcessingPopup, keyPressed, keyTyped, mouseClicked, mouseEntered, mouseExited, removeGraphicalSelectionListener, setBorder, setBounds, setSelectionActionsEnabled, testPopupTrigger |
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 |
Constructor Detail |
---|
public SquareSelectionPanel()
Method Detail |
---|
public int getNumberOfControlPoints()
getNumberOfControlPoints
in class AbstractRegionSelectionPanel
public Cursor getControlPointCursor(int index)
getControlPointCursor
in class AbstractRegionSelectionPanel
public void initializeControlPoints(int x, int y)
initializeControlPoints
in class AbstractRegionSelectionPanel
x
- x-coordinate of starting pointy
- y-coordinate of starting pointpublic void updateActiveControlPoint(int x, int y)
updateActiveControlPoint
in class AbstractRegionSelectionPanel
x
- x-coordinate of the new pointy
- y-coordinate of the new pointpublic void paintComponent(Graphics g)
AbstractRegionSelectionPanel
paintComponent
in class AbstractRegionSelectionPanel
g
- Graphics context in which to drawpublic AffineTransform makeAffineTransform()
makeAffineTransform
in class AbstractRegionSelectionPanel
public boolean isValidSelection()
isValidSelection
in class AbstractRegionSelectionPanel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |