pga
Class TSPPresentationCanvas

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--pga.TSPPresentationCanvas

public class TSPPresentationCanvas
extends java.awt.Canvas

Komponenta umoznujici zobrazeni mest a cesty.

See Also:
Serialized Form

Field Summary
 boolean drawPath
          zda se ma kreslit cesta
protected  boolean eventChanged
          zda posledni akce uzivatele zmenila stav komponenty
protected  GATSPGenome gen
          pro uchovavani souradnic mest
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
TSPPresentationCanvas(GAGenome gen)
          Vytvori novou instanci dle danych bodu.
 
Method Summary
 java.awt.Dimension getMinSize()
          Vrati minimalni velikost komponenty
 java.awt.Dimension getPreferredSize()
          Vrati pozadovanou velikost komponenty
 TSPProblem getTSP()
          Vrati instanci problemu - souradnice mest
 void init(GATSPGenome newGen)
          Reinicializuje canvas
 boolean notEnough()
          Test, zda je instance vyhovujici pro reseni genetickym algoritmem.
 void paint(java.awt.Graphics g)
          Prekresli plochu komponenty.
 boolean setTSPGenome(GATSPGenome newGen)
          Nastavi instanci problemu - souradnice mest
 
Methods inherited from class java.awt.Canvas
addNotify
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, checkImage, checkImage, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

gen

protected GATSPGenome gen
pro uchovavani souradnic mest

drawPath

public boolean drawPath
zda se ma kreslit cesta

eventChanged

protected boolean eventChanged
zda posledni akce uzivatele zmenila stav komponenty
Constructor Detail

TSPPresentationCanvas

public TSPPresentationCanvas(GAGenome gen)
Vytvori novou instanci dle danych bodu.
Method Detail

init

public void init(GATSPGenome newGen)
Reinicializuje canvas

getTSP

public TSPProblem getTSP()
Vrati instanci problemu - souradnice mest

setTSPGenome

public boolean setTSPGenome(GATSPGenome newGen)
Nastavi instanci problemu - souradnice mest

paint

public void paint(java.awt.Graphics g)
Prekresli plochu komponenty.

Nakresli ram, mesta, prip. cisla mest a trasu.

Overrides:
paint in class java.awt.Canvas

getPreferredSize

public java.awt.Dimension getPreferredSize()
Vrati pozadovanou velikost komponenty
Overrides:
getPreferredSize in class java.awt.Component

getMinSize

public java.awt.Dimension getMinSize()
Vrati minimalni velikost komponenty

notEnough

public boolean notEnough()
Test, zda je instance vyhovujici pro reseni genetickym algoritmem.