protoj.drawing
Class PageObject

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by protoj.drawing.GraphicObject
                      extended by protoj.drawing.PageObject
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class PageObject
extends GraphicObject

Class PageObject is the GraphicObject extension which holds a rectangle shape.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  double angle
          The rotation angle
protected  CanvasPage canvasPage
          A local reference to the canvas Page object.
protected  int gridx
          The size of a page block
protected  int gridy
          The size of a page block
protected  int height
          The image height
protected  java.awt.Image image
          An instance of the image class
protected  java.awt.Point location
          The location of the upper-left hand corner of the box.
protected  java.lang.String name
          The path to the image file.
protected  int scale
          the size of the zoom of the page
protected  int width
          The image width
 
Fields inherited from class protoj.drawing.GraphicObject
aBrush, arrowsOn, backgroundColor, color, controlPoints, fillPattern, foregroundColor, graphic, graphicType, paint, savedColor, savedFillPattern, savedStroke, saveTransform, shape, stroke
 
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
PageObject(int width, int height, int x, int y, java.awt.Color c, java.awt.Color bgc, java.util.Vector p, java.util.Vector cPoints, java.awt.BasicStroke bs, int pattern, int brush)
          Construct this with the given Shape, Color, FillStyle, and ControlPoints objects.
 
Method Summary
 java.lang.Object clone()
          Returns a derived copy of this.object returns - A copy of this.
 void draw(java.awt.Graphics2D g2D, float zoom)
          Draws this Page object to the screen.
 int getHeight()
          Returns the size of the page grid height
 int getMaxX()
          Returns the int X value of the right side of the Rectangle which bounds this.shape.
 int getMaxY()
          Returns the int Y value of the bottom side of the Rectangle which bounds this.shape.
 int getMinX()
          Returns the int X value of the left side of the Rectangle which bounds this.shape.
 int getMinY()
          Returns the int Y value of the top side of the Rectangle which bounds this.shape.
 java.util.Vector getSaveBundle()
          Returns a Vector with all the necessary save information.
 int getWidth()
          returns the size of the page grid width
 void rotate(double theta, double anchorX, double anchorY)
          Rotates this.location around point (anchorX, anchorY) by theta radians.
 void scale(int chgx, int chgy)
          Scales the width and height of this.shape
 void setControlPoints()
          Sets this.controlPoints based on the current PathIterator of this.shape.
 void setGridSize(int x, int y)
          Sets the size of the pages
 void setHeight(int y)
          Sets the size of the page grid height
 void setMaxX(int newMaxX)
          Sets the int newMaxX value as the right side of the Rectangle which bounds this.shape.
 void setMaxY(int newMaxY)
          Sets the int newMaxY value as the bottom side of the Rectangle which bounds this.shape.
 void setMinX(int newMinX)
          Sets the int newMinX value as the left side of the Rectangle which bounds this.shape.
 void setMinY(int newMinY)
          Sets the int newMinY value as the top side of the Rectangle which bounds this.shape.
 void setShape()
          Sets this.shape based on the points currently in this.controlPoints.
 void setWidth(int x)
          Sets the size of the page grid width
 void translate(float deltaX, float deltaY)
          Translates the position of this.shape by the given deltaX and deltaY values.
 void translateControlPoint(int a, int b, int c)
          translateControlPoint(int, int, int) is disabled for an ImageObject.
 
Methods inherited from class protoj.drawing.GraphicObject
addPoint, containedIn, copyControlPoints, deriveImage, flipHorizontally, flipVertically, getArrows, getBackgroundColor, getBrushNumber, getColor, getControlPoints, getFontSize, getFontSizeID, getFontStyle, getGraphic, getGraphicType, getMidPoint, getPaint, getPattern, getShape, getStroke, getTouchedControlPoint, isPointOnShape, resetColor, resetPattern, resetStroke, saveCurrentColor, saveCurrentPattern, saveCurrentStroke, scale, scale, setArrows, setBackgroundColor, setBrushNumber, setColor, setFillPattern, setFontSize, setFontStyle, setHorizontalCenter, setLastPoint, setNewControlPoints, setPaint, setSecondPoint, setStroke, setVerticalCenter, translateControlPoint
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

location

protected java.awt.Point location
The location of the upper-left hand corner of the box.


name

protected java.lang.String name
The path to the image file.


image

protected java.awt.Image image
An instance of the image class


width

protected int width
The image width


height

protected int height
The image height


angle

protected double angle
The rotation angle


scale

protected int scale
the size of the zoom of the page


canvasPage

protected CanvasPage canvasPage
A local reference to the canvas Page object.


gridx

protected int gridx
The size of a page block


gridy

protected int gridy
The size of a page block

Constructor Detail

PageObject

public PageObject(int width,
                  int height,
                  int x,
                  int y,
                  java.awt.Color c,
                  java.awt.Color bgc,
                  java.util.Vector p,
                  java.util.Vector cPoints,
                  java.awt.BasicStroke bs,
                  int pattern,
                  int brush)
Construct this with the given Shape, Color, FillStyle, and ControlPoints objects.

Parameters:
width - - The int width to store in this.width.
height - - The int height to store in this.height.
x - - The int x grid block to store in this.gridx.
y - - The int Y grid block to store in this.gridy.
c - - The Color object to store in this.color.
bgc - - The Color object to store in this.backgroundColor.
p - - The Vector to store in this.paint.
cPoints - - Vector object to store in this.controlPoints.
bs - - The BasicStroke object to store in this.stroke.
pattern - - The pattern setting to store in this.pattern
brush - - The brush setting to store in this.brush
Method Detail

clone

public java.lang.Object clone()
Returns a derived copy of this.object returns - A copy of this.

Overrides:
clone in class GraphicObject

setShape

public void setShape()
Sets this.shape based on the points currently in this.controlPoints.

Overrides:
setShape in class GraphicObject

setControlPoints

public void setControlPoints()
Sets this.controlPoints based on the current PathIterator of this.shape.

Overrides:
setControlPoints in class GraphicObject

draw

public void draw(java.awt.Graphics2D g2D,
                 float zoom)
Draws this Page object to the screen.

Overrides:
draw in class GraphicObject
Parameters:
g2D - - the graphics2d reference
zoom - - the float value of the window zoom

setGridSize

public void setGridSize(int x,
                        int y)
Sets the size of the pages

Overrides:
setGridSize in class GraphicObject

setWidth

public void setWidth(int x)
Sets the size of the page grid width

Overrides:
setWidth in class GraphicObject
Parameters:
- - The width of the pageGrid

setHeight

public void setHeight(int y)
Sets the size of the page grid height

Overrides:
setHeight in class GraphicObject
Parameters:
- - The height of the pageGrid

getWidth

public int getWidth()
returns the size of the page grid width

Overrides:
getWidth in class GraphicObject

getHeight

public int getHeight()
Returns the size of the page grid height

Overrides:
getHeight in class GraphicObject

translate

public void translate(float deltaX,
                      float deltaY)
Translates the position of this.shape by the given deltaX and deltaY values.

Overrides:
translate in class GraphicObject
Parameters:
deltaX - - The int value by which to alter the X position of this.shape.
deltaY - - The int value by which to alter the Y position of this.shape.

getSaveBundle

public java.util.Vector getSaveBundle()
Returns a Vector with all the necessary save information.

Overrides:
getSaveBundle in class GraphicObject

scale

public void scale(int chgx,
                  int chgy)
Scales the width and height of this.shape

Parameters:
scalex - - A double value representing the scale width
scaley - - A double value representing the scale height

rotate

public void rotate(double theta,
                   double anchorX,
                   double anchorY)
Rotates this.location around point (anchorX, anchorY) by theta radians.

Overrides:
rotate in class GraphicObject
Parameters:
theta - - The double value representing an angle in radians.
anchorX - - The double value of the x-coordinate of a point.
anchorY - - The double value of the y-coordinate of a point.

getMinX

public int getMinX()
Returns the int X value of the left side of the Rectangle which bounds this.shape.

Overrides:
getMinX in class GraphicObject
Returns:
- The int value of the left side of the Rectangle which bounds this.shape.

getMinY

public int getMinY()
Returns the int Y value of the top side of the Rectangle which bounds this.shape.

Overrides:
getMinY in class GraphicObject
Returns:
- The int value of the top side of the Rectangle which bounds this.shape.

getMaxX

public int getMaxX()
Returns the int X value of the right side of the Rectangle which bounds this.shape.

Overrides:
getMaxX in class GraphicObject
Returns:
- The int value of the right side of the Rectangle which bounds this.shape.

getMaxY

public int getMaxY()
Returns the int Y value of the bottom side of the Rectangle which bounds this.shape.

Overrides:
getMaxY in class GraphicObject
Returns:
- The int value of the bottom side of the Rectangle which bounds this.shape.

setMinX

public void setMinX(int newMinX)
Sets the int newMinX value as the left side of the Rectangle which bounds this.shape.

Overrides:
setMinX in class GraphicObject
Parameters:
newMinX - - The int value to be set as the left side of the Rectangle which bounds this.shape.

setMinY

public void setMinY(int newMinY)
Sets the int newMinY value as the top side of the Rectangle which bounds this.shape.

Overrides:
setMinY in class GraphicObject
Parameters:
newMinY - - The int value to be set as the top side of the Rectangle which bounds this.shape.

setMaxX

public void setMaxX(int newMaxX)
Sets the int newMaxX value as the right side of the Rectangle which bounds this.shape.

Overrides:
setMaxX in class GraphicObject
Parameters:
newMaxX - - The int value to be set as the right side of the Rectangle which bounds this.shape.

setMaxY

public void setMaxY(int newMaxY)
Sets the int newMaxY value as the bottom side of the Rectangle which bounds this.shape.

Overrides:
setMaxY in class GraphicObject
Parameters:
newMaxY - - The int value to be set as the bottom side of the Rectangle which bounds this.shape.

translateControlPoint

public void translateControlPoint(int a,
                                  int b,
                                  int c)
translateControlPoint(int, int, int) is disabled for an ImageObject.