javapoint
Class Slide

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLayeredPane
                  extended by javapoint.Slide
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, javax.accessibility.Accessible

public class Slide
extends javax.swing.JLayeredPane
implements java.awt.print.Printable

This class defines a slide, which is a rectangular area on which the user can create and manipulate components.
Technically, a slide is a layered pane, each user-created component occupying a new layer on top of the others.
However, the top layer is occupied by an instance of SlideGlassPane.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JLayeredPane
javax.swing.JLayeredPane.AccessibleJLayeredPane
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.awt.Color CONTAINER_BACKGROUND_COLOR
           
static int DEFAULT_HEIGHT
           
static int DEFAULT_WIDTH
           
 java.util.ArrayList<GraphicObject> GraphicObjectArray
           
static int TOP_LAYER_POSITION
           
 
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
 
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 java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Slide(MainFrame mainFrame)
           
 
Method Summary
 java.awt.Component add(java.awt.Component c, int i)
           
protected  void addImpl(java.awt.Component component, java.lang.Object constraints, int index)
           
 void applyZoom()
           
 void flipHorizontal()
           
 void flipVertical()
           
 java.awt.image.BufferedImage getBackgroundImage()
           
 java.awt.image.BufferedImage getBuffer()
           
 java.awt.Graphics2D getBufferGraphics()
           
 boolean getDisplayImage()
           
 MainFrame getMainFrame()
           
 GraphicObject getSelection()
           
 int getSlideType()
           
 java.awt.Point getUnzoomedPoint(java.awt.Point zoomedPoint)
           
 float getZoom()
           
 void paint(java.awt.Graphics graphics)
           
 int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int page)
           
 void rotate(double angleRadians)
           
 void setBackground(java.awt.image.BufferedImage bg)
           
 void setDisplayImage(boolean displayImage)
           
 void setSelection(GraphicObject selection)
           
 void setSlideType(int slideType)
           
 void startResizingSelection()
           
 
Methods inherited from class javax.swing.JLayeredPane
getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paramString, putLayer, remove, removeAll, setLayer, setLayer, setPosition
 
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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, addContainerListener, 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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GraphicObjectArray

public java.util.ArrayList<GraphicObject> GraphicObjectArray

CONTAINER_BACKGROUND_COLOR

public static final java.awt.Color CONTAINER_BACKGROUND_COLOR

DEFAULT_WIDTH

public static final int DEFAULT_WIDTH
See Also:
Constant Field Values

DEFAULT_HEIGHT

public static final int DEFAULT_HEIGHT
See Also:
Constant Field Values

TOP_LAYER_POSITION

public static final int TOP_LAYER_POSITION
See Also:
Constant Field Values
Constructor Detail

Slide

public Slide(MainFrame mainFrame)
Parameters:
mainFrame -
Should not be null
Shared parameter
Method Detail

setDisplayImage

public final void setDisplayImage(boolean displayImage)
Parameters:
displayImage -

getDisplayImage

public final boolean getDisplayImage()

setSlideType

public final void setSlideType(int slideType)
Parameters:
slideType -
Range: ?

getSlideType

public final int getSlideType()
Returns:

Range: ?

getBackgroundImage

public final java.awt.image.BufferedImage getBackgroundImage()
Returns:

Maybe null
Shared

getSelection

public final GraphicObject getSelection()
Returns:

Maybe null
Shared

add

public java.awt.Component add(java.awt.Component c,
                              int i)
Overrides:
add in class java.awt.Container

setSelection

public final void setSelection(GraphicObject selection)
Parameters:
selection -
Can be null
Shared parameter

setBackground

public void setBackground(java.awt.image.BufferedImage bg)

paint

public final void paint(java.awt.Graphics graphics)
Overrides:
paint in class javax.swing.JLayeredPane

getUnzoomedPoint

public final java.awt.Point getUnzoomedPoint(java.awt.Point zoomedPoint)
Parameters:
zoomedPoint -
Should not be null
Returns:

A non-null value
A new value

getZoom

public final float getZoom()
Returns:

Range: [this.getMainFrame().getZoomSlider().getMinValue() / 100F .. this.getMainFrame().getZoomSlider().getMaxValue() / 100F]

applyZoom

public final void applyZoom()

getBuffer

public final java.awt.image.BufferedImage getBuffer()
Returns:

A possibly null value
A shared value

getBufferGraphics

public final java.awt.Graphics2D getBufferGraphics()

getMainFrame

public final MainFrame getMainFrame()
Returns:

A non-null value
A shared value

addImpl

protected final void addImpl(java.awt.Component component,
                             java.lang.Object constraints,
                             int index)
Overrides:
addImpl in class javax.swing.JLayeredPane

startResizingSelection

public final void startResizingSelection()

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pf,
                 int page)
          throws java.awt.print.PrinterException
Specified by:
print in interface java.awt.print.Printable
Throws:
java.awt.print.PrinterException

rotate

public final void rotate(double angleRadians)

flipHorizontal

public final void flipHorizontal()

flipVertical

public final void flipVertical()