optics.graphics
Class SpotPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by optics.graphics.SpotPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class SpotPanel
extends javax.swing.JPanel

Class to form Spot Diagram Panel.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
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
 
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.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SpotPanel(double range)
          Constuctor to form basic SpotDiagram with centre at 0,0
SpotPanel(double x, double y, double range)
          Constructor to form SpotDiangram with centre specified by x,y pair.
SpotPanel(javax.vecmath.Point2d c, double range)
          Constrcutor to form Spot Diagram with specified centre
 
Method Summary
 void addSpot(double x, double y)
          Method to add a spot to the diagram in default colour
 void addSpot(double x, double y, java.awt.Color c)
          Method to add a spot to the diagram in specified colour
 void addSpot(javax.vecmath.Point2d p)
          Method to add a spot to the diagram in default colour
 void addSpot(javax.vecmath.Point2d p, java.awt.Color c)
          Method to add spot of specified colour
 void addSpot(Spot s)
          Method to add a spot to the diagram
 void clear()
          Method to clear the spots
 int getNumber()
          Method to get the number of spots
 Spot getSpot(int i)
          Method to get a specied spot back
 void paintComponent(java.awt.Graphics g)
          Overload the paintComponent method do do the work
 void setCentre(double x, double y)
          Method to set centre with two doubles.
 void setCentre(javax.vecmath.Point2d c)
          Method to set the centre
 void setCrossAxis(boolean b)
          Void to contol of central cross
 void setDefaultSpotColor(java.awt.Color c)
          Void to set the default Spot colour
 void setRange(double range)
          Void method to set the range
 void setRings(int n)
          Void to set the number of rings on the plane
 void setSpotSize(int m)
          Void to set the spots size from it defaults size of 4 pixels
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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
 
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, 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
 

Constructor Detail

SpotPanel

public SpotPanel(double range)
Constuctor to form basic SpotDiagram with centre at 0,0


SpotPanel

public SpotPanel(double x,
                 double y,
                 double range)
Constructor to form SpotDiangram with centre specified by x,y pair.


SpotPanel

public SpotPanel(javax.vecmath.Point2d c,
                 double range)
Constrcutor to form Spot Diagram with specified centre

Method Detail

setRings

public void setRings(int n)
Void to set the number of rings on the plane

Parameters:
n - Number of rings

setCrossAxis

public void setCrossAxis(boolean b)
Void to contol of central cross

Parameters:
b - on/off switch (default is on)

setSpotSize

public void setSpotSize(int m)
Void to set the spots size from it defaults size of 4 pixels

Parameters:
m - Size of stop in pixels

setDefaultSpotColor

public void setDefaultSpotColor(java.awt.Color c)
Void to set the default Spot colour

Parameters:
c - The Color

setCentre

public void setCentre(javax.vecmath.Point2d c)
Method to set the centre

Parameters:
c - The centre

setCentre

public void setCentre(double x,
                      double y)
Method to set centre with two doubles.

Parameters:
x -
y -

setRange

public void setRange(double range)
Void method to set the range

Parameters:
range - The range

addSpot

public void addSpot(javax.vecmath.Point2d p)
Method to add a spot to the diagram in default colour

Parameters:
p - The point

addSpot

public void addSpot(double x,
                    double y)
Method to add a spot to the diagram in default colour

Parameters:
x - The x component
y - The y component

addSpot

public void addSpot(javax.vecmath.Point2d p,
                    java.awt.Color c)
Method to add spot of specified colour


addSpot

public void addSpot(double x,
                    double y,
                    java.awt.Color c)
Method to add a spot to the diagram in specified colour

Parameters:
x - The x component
y - The y component
c - The colour

addSpot

public void addSpot(Spot s)
Method to add a spot to the diagram

Parameters:
s - The Spot

clear

public void clear()
Method to clear the spots


getSpot

public Spot getSpot(int i)
Method to get a specied spot back


getNumber

public int getNumber()
Method to get the number of spots

Returns:
int number of spots

paintComponent

public void paintComponent(java.awt.Graphics g)
Overload the paintComponent method do do the work

Overrides:
paintComponent in class javax.swing.JComponent