sugar
Class Display

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by sugar.Display
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class Display
extends javax.swing.JFrame

Display

This class enables simple drawing

Copyright: Copyright (c) 2003

Company: FEL CVUT

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
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.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Method Summary
 void clear()
           
 void clear(java.awt.Color c)
           
 void drawCircle(double x, double y, double radius)
           
 void drawCircle(double x, double y, double radius, java.awt.Color color)
           
 void drawLine(double x, double y)
          Draw line from present position to specified position.
 void drawLine(double x, double y, java.awt.Color c)
          Draw line from present position to specified position using given color.
 void drawLine(double x1, double y1, double x2, double y2)
          Draw line from position 1 to position 2.
 void drawLine(double x1, double y1, double x2, double y2, java.awt.Color color)
          Draw line from position 1 to position 2 using given color.
 void drawPoint(double x, double y)
           
 void drawPoint(double x, double y, java.awt.Color c)
          Draw point on specified position using given color.
 void drawRect(double x, double y, double w, double h)
           
 void drawRect(double x, double y, double w, double h, java.awt.Color color)
           
 void drawString(double x, double y, java.lang.String text, int fontSize)
          Draw text on specified position using given size.
 void drawString(double x, double y, java.lang.String text, int fontSize, java.awt.Color color)
          Draw text on specified position using given size and color.
 void fillCircle(double x, double y, double radius)
           
 void fillCircle(double x, double y, double radius, java.awt.Color color)
           
 void fillRect(double x, double y, double w, double h)
           
 void fillRect(double x, double y, double w, double h, java.awt.Color color)
           
static void free()
           
static Display getDisplay(int size)
           
static Display getDisplay(int width, int height)
           
static Display getDisplay(int width, int height, java.lang.String title)
           
static Display getDisplay(int size, java.lang.String title)
           
 int height()
           
static void main(java.lang.String[] args)
           
 void moveCursor(double x, double y)
          Move cursor to position
 void setColor(java.awt.Color col)
           
 void setTitle(java.lang.String title)
           
 int width()
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, checkImage, checkImage, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Method Detail

getDisplay

public static Display getDisplay(int size)
Parameters:
size -
Returns:

getDisplay

public static Display getDisplay(int size,
                                 java.lang.String title)
Parameters:
size -
title -
Returns:

getDisplay

public static Display getDisplay(int width,
                                 int height)
Parameters:
width -
height -
Returns:

getDisplay

public static Display getDisplay(int width,
                                 int height,
                                 java.lang.String title)
Parameters:
width -
height -
title -
Returns:

free

public static void free()

moveCursor

public void moveCursor(double x,
                       double y)
Move cursor to position

Parameters:
x -
y -

drawString

public void drawString(double x,
                       double y,
                       java.lang.String text,
                       int fontSize)
Draw text on specified position using given size.

Parameters:
x -
y -
text -
fontSize -

drawString

public void drawString(double x,
                       double y,
                       java.lang.String text,
                       int fontSize,
                       java.awt.Color color)
Draw text on specified position using given size and color.

Parameters:
x -
y -
text -
fontSize -
color -

drawPoint

public void drawPoint(double x,
                      double y)
Parameters:
x -
y -

drawPoint

public void drawPoint(double x,
                      double y,
                      java.awt.Color c)
Draw point on specified position using given color.

Parameters:
x -
y -
c -

drawLine

public void drawLine(double x,
                     double y)
Draw line from present position to specified position.

Parameters:
x -
y -

drawLine

public void drawLine(double x,
                     double y,
                     java.awt.Color c)
Draw line from present position to specified position using given color.

Parameters:
x -
y -
c -

drawLine

public void drawLine(double x1,
                     double y1,
                     double x2,
                     double y2)
Draw line from position 1 to position 2.

Parameters:
x1 -
y1 -
x2 -
y2 -

drawLine

public void drawLine(double x1,
                     double y1,
                     double x2,
                     double y2,
                     java.awt.Color color)
Draw line from position 1 to position 2 using given color.

Parameters:
x1 -
y1 -
x2 -
y2 -
color -

drawRect

public void drawRect(double x,
                     double y,
                     double w,
                     double h)
Parameters:
x -
y -
w -
h -

drawRect

public void drawRect(double x,
                     double y,
                     double w,
                     double h,
                     java.awt.Color color)
Parameters:
x -
y -
w -
h -
color -

fillRect

public void fillRect(double x,
                     double y,
                     double w,
                     double h)
Parameters:
x -
y -
w -
h -

fillRect

public void fillRect(double x,
                     double y,
                     double w,
                     double h,
                     java.awt.Color color)
Parameters:
x -
y -
w -
h -
color -

drawCircle

public void drawCircle(double x,
                       double y,
                       double radius)
Parameters:
x -
y -
radius -

drawCircle

public void drawCircle(double x,
                       double y,
                       double radius,
                       java.awt.Color color)
Parameters:
x -
y -
radius -
color -

fillCircle

public void fillCircle(double x,
                       double y,
                       double radius)
Parameters:
x -
y -
radius -

fillCircle

public void fillCircle(double x,
                       double y,
                       double radius,
                       java.awt.Color color)
Parameters:
x -
y -
radius -
color -

setColor

public void setColor(java.awt.Color col)
Parameters:
col -

setTitle

public void setTitle(java.lang.String title)
Overrides:
setTitle in class java.awt.Frame
Parameters:
title -

clear

public void clear(java.awt.Color c)
Parameters:
c -

clear

public void clear()

width

public int width()
Returns:

height

public int height()
Returns:

main

public static void main(java.lang.String[] args)