|
||||||||||
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.vizzini.ui.graphics.AbstractViewerSwing
public abstract class AbstractViewerSwing
Provides base functionality for Swing 3D viewers.
Nested Class Summary | |
---|---|
(package private) class |
AbstractViewerSwing.SelectShapeAction
Provides an Action for selecting a shape. |
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 | |
---|---|
protected IShapeCanvas |
_canvas
The canvas. |
protected int |
_xRotation
The X rotation angle in degrees. |
protected int |
_yRotation
The Y rotation angle in degrees. |
protected int |
_zRotation
The Z rotation angle in degrees. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, 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 org.vizzini.ui.graphics.IViewer |
---|
MAGNIFICATION_FACTOR |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
AbstractViewerSwing()
Construct this object. |
Method Summary | |
---|---|
void |
add(IShape shape)
Add the given shape. |
void |
addPopupMenu()
Add a new popup menu to this component. |
void |
addToPopupMenu(Action action)
Add the given action into the popup menu. |
void |
addToPopupMenu(JMenuItem menuItem)
Add the given menu item into the popup menu. |
protected void |
configureShapeMenu(JMenu shapeMenu)
Configure the shape menu. |
protected JPanel |
createControlPanel()
Create the control panel. |
protected JPanel |
createMagnifyPanel()
Create a panel containing the magnification controls. |
JPopupMenu |
createPopupMenu()
Create a new popup menu. |
protected abstract IShapeCanvas |
createShapeCanvas()
Create a new shape canvas of the appropriate type. |
protected abstract AdjustmentListener |
createXAdjustmentListener()
Create a X adjustment listener. |
protected abstract AdjustmentListener |
createYAdjustmentListener()
Create a Y adjustment listener. |
protected abstract AdjustmentListener |
createZAdjustmentListener()
Create a Z adjustment listener. |
protected void |
fillAdditionalPopupMenuItems(JPopupMenu popupMenu)
Fill in additional popup menu items. |
double |
getMagnify()
Return the magnification. |
double |
getPerspectiveConstant()
Return the perspective constant. |
protected JPopupMenu |
getPopupMenu()
Return the popup menu, creating it if necessary. |
protected IShapeCanvas |
getShapeCanvas()
Return the shape canvas. |
protected JMenu |
getShapeMenu()
|
Action |
getZoomInAction()
Return the zoom in action. |
Action |
getZoomOutAction()
Return the zoom out action. |
void |
insertIntoPopupMenu(Action action,
int index)
Insert the given action into the popup menu at the given index. |
void |
insertIntoPopupMenu(JMenuItem menuItem,
int index)
Insert the given menu item into the popup menu at the given index. |
protected boolean |
isMagnifyLayoutHorizontal()
Return true if the magnify panel layout should be horizontal. |
boolean |
isShapeMenuUsed()
|
boolean |
isViewPointLightUsed()
|
protected abstract void |
moveViewPointToShape(IShape shape)
Move the view point to the given shape. |
void |
remove(IShape shape)
Remove the given shape. |
void |
setCanvasBackground(Color color)
Set the canvas background color. |
void |
setMagnify(double magnify)
Set the magnification. |
void |
setMagnifyPanelVisible(boolean isVisible)
Set the visibility of the magnification panel. |
void |
setPerspectiveConstant(double d)
Set the perspective constant. |
void |
setShapeMenuUsed(boolean isShapeMenuUsed)
|
void |
setViewPointLightUsed(boolean isViewPointLightUsed)
|
void |
setXScrollBarBlockIncrement(int increment)
Set the block increment on the X scroll bar. |
void |
setXScrollBarUnitIncrement(int increment)
Set the unit increment on the X scroll bar. |
void |
setXScrollBarValues(int value,
int visible,
int minimum,
int maximum)
Set the values on the X scroll bar. |
void |
setXScrollBarVisible(boolean isVisible)
Set the visibility of the X scroll bar. |
void |
setYScrollBarBlockIncrement(int increment)
Set the block increment on the Y scroll bar. |
void |
setYScrollBarUnitIncrement(int increment)
Set the unit increment on the Y scroll bar. |
void |
setYScrollBarValues(int value,
int visible,
int minimum,
int maximum)
Set the values on the Y scroll bar. |
void |
setYScrollBarVisible(boolean isVisible)
Set the visibility of the Y scroll bar. |
void |
setZScrollBarBlockIncrement(int increment)
Set the block increment on the Z scroll bar. |
void |
setZScrollBarUnitIncrement(int increment)
Set the unit increment on the Z scroll bar. |
void |
setZScrollBarValues(int value,
int visible,
int minimum,
int maximum)
Set the values on the Z scroll bar. |
void |
setZScrollBarVisible(boolean isVisible)
Set the visibility of the Z scroll bar. |
void |
update()
Update the shapes in this viewer. |
void |
zoomInActionPerformed(ActionEvent event)
Callback for the zoom in action. |
void |
zoomOutActionPerformed(ActionEvent event)
Callback for the zoom out action. |
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 |
Methods inherited from interface org.vizzini.ui.graphics.IViewerSwing |
---|
addStarfieldBackground |
Field Detail |
---|
protected IShapeCanvas _canvas
protected int _xRotation
protected int _yRotation
protected int _zRotation
Constructor Detail |
---|
public AbstractViewerSwing()
Method Detail |
---|
public void add(IShape shape)
add
in interface IViewer
public void addPopupMenu()
addPopupMenu
in interface IViewerSwing
public void addToPopupMenu(Action action)
addToPopupMenu
in interface IJPopupMenuOwner
action
- The Action
object to add.public void addToPopupMenu(JMenuItem menuItem)
addToPopupMenu
in interface IJPopupMenuOwner
menuItem
- The JMenuItem
object to add.public JPopupMenu createPopupMenu()
createPopupMenu
in interface IViewerSwing
public double getMagnify()
getMagnify
in interface IViewer
public double getPerspectiveConstant()
getPerspectiveConstant
in interface IViewer
public Action getZoomInAction()
getZoomInAction
in interface IViewerSwing
public Action getZoomOutAction()
getZoomOutAction
in interface IViewerSwing
public void insertIntoPopupMenu(Action action, int index)
insertIntoPopupMenu
in interface IJPopupMenuOwner
action
- The Action
object to insert.index
- Specifies the position at which to insert the
Action
, where 0 is the first.public void insertIntoPopupMenu(JMenuItem menuItem, int index)
insertIntoPopupMenu
in interface IJPopupMenuOwner
menuItem
- The JMenuItem
object to insert.index
- Specifies the position at which to insert the menu
item, where 0 is the first.public boolean isShapeMenuUsed()
isShapeMenuUsed
in interface IViewerSwing
public boolean isViewPointLightUsed()
isViewPointLightUsed
in interface IViewer
public void remove(IShape shape)
remove
in interface IViewer
public void setCanvasBackground(Color color)
setCanvasBackground
in interface IViewer
public void setMagnify(double magnify)
setMagnify
in interface IViewer
public void setMagnifyPanelVisible(boolean isVisible)
setMagnifyPanelVisible
in interface IViewer
public void setPerspectiveConstant(double d)
setPerspectiveConstant
in interface IViewer
public void setShapeMenuUsed(boolean isShapeMenuUsed)
setShapeMenuUsed
in interface IViewerSwing
isShapeMenuUsed
- the isShapeMenuUsed to setpublic void setViewPointLightUsed(boolean isViewPointLightUsed)
setViewPointLightUsed
in interface IViewer
isViewPointLightUsed
- the isViewPointLightUsed to setpublic void setXScrollBarBlockIncrement(int increment)
setXScrollBarBlockIncrement
in interface IViewer
increment
- The amount by which to increment or decrement the
scroll bar's value.public void setXScrollBarUnitIncrement(int increment)
setXScrollBarUnitIncrement
in interface IViewer
increment
- The amount by which to increment or decrement the
scroll bar's value.public void setXScrollBarValues(int value, int visible, int minimum, int maximum)
setXScrollBarValues
in interface IViewer
value
- The position in the current window.visible
- The amount visible per page.minimum
- The minimum value of the scroll bar.maximum
- The maximum value of the scroll bar.public void setXScrollBarVisible(boolean isVisible)
setXScrollBarVisible
in interface IViewer
isVisible
- Flag indicating if the scroll bar is visible.public void setYScrollBarBlockIncrement(int increment)
setYScrollBarBlockIncrement
in interface IViewer
increment
- The amount by which to increment or decrement the
scroll bar's value.public void setYScrollBarUnitIncrement(int increment)
setYScrollBarUnitIncrement
in interface IViewer
increment
- The amount by which to increment or decrement the
scroll bar's value.public void setYScrollBarValues(int value, int visible, int minimum, int maximum)
setYScrollBarValues
in interface IViewer
value
- The position in the current window.visible
- The amount visible per page.minimum
- The minimum value of the scroll bar.maximum
- The maximum value of the scroll bar.public void setYScrollBarVisible(boolean isVisible)
setYScrollBarVisible
in interface IViewer
isVisible
- Flag indicating if the scroll bar is visible.public void setZScrollBarBlockIncrement(int increment)
setZScrollBarBlockIncrement
in interface IViewer
increment
- The amount by which to increment or decrement the
scroll bar's value.public void setZScrollBarUnitIncrement(int increment)
setZScrollBarUnitIncrement
in interface IViewer
increment
- The amount by which to increment or decrement the
scroll bar's value.public void setZScrollBarValues(int value, int visible, int minimum, int maximum)
setZScrollBarValues
in interface IViewer
value
- The position in the current window.visible
- The amount visible per page.minimum
- The minimum value of the scroll bar.maximum
- The maximum value of the scroll bar.public void setZScrollBarVisible(boolean isVisible)
setZScrollBarVisible
in interface IViewer
isVisible
- Flag indicating if the scroll bar is visible.public void update()
update
in interface IViewer
public void zoomInActionPerformed(ActionEvent event)
public void zoomOutActionPerformed(ActionEvent event)
protected abstract IShapeCanvas createShapeCanvas()
protected abstract AdjustmentListener createXAdjustmentListener()
protected abstract AdjustmentListener createYAdjustmentListener()
protected abstract AdjustmentListener createZAdjustmentListener()
protected abstract void moveViewPointToShape(IShape shape)
shape
- Shape.protected void configureShapeMenu(JMenu shapeMenu)
protected JPanel createControlPanel()
protected JPanel createMagnifyPanel()
protected void fillAdditionalPopupMenuItems(JPopupMenu popupMenu)
protected JPopupMenu getPopupMenu()
protected IShapeCanvas getShapeCanvas()
protected JMenu getShapeMenu()
protected boolean isMagnifyLayoutHorizontal()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |