cz.cuni.jagrlib.gui
Class PlugGUI

java.lang.Object
  extended by cz.cuni.jagrlib.gui.PlugGUI
Direct Known Subclasses:
PlugGUIImproved

public abstract class PlugGUI
extends java.lang.Object

Abstract class for visual representation of a plug.

See Also:
PlugGUI.java

Field Summary
 InfoPlug info
          Information about Plug.
protected  int maxX
          Maximal plug position (X-coordinate).
protected  int maxY
          Maximal plug position (Y-coordinate).
static int PGI_ORIENTATION_SOUTH
          Initial plug orientation.
 
Constructor Summary
PlugGUI()
           
 
Method Summary
abstract  boolean contains(int px, int py)
          Tests, if point lies on the plug.
 int getOrientaion()
          Returns plug orientation.
abstract  java.lang.String getToolTipText()
          Tooltip text for the plug.
abstract  int getX()
          Gets relative x-coordinate of the plug.
abstract  int getY()
          Gets relative y-coordinate of the plug.
abstract  void movePlug(int nx, int ny)
          Moves the Plug.
abstract  void paintItem(java.awt.Graphics g)
          Paint bonus graphics on module panel.
abstract  void resize(int nx, int ny)
          The Plug's module was resized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

info

public InfoPlug info
Information about Plug.


maxX

protected int maxX
Maximal plug position (X-coordinate).


maxY

protected int maxY
Maximal plug position (Y-coordinate).


PGI_ORIENTATION_SOUTH

public static final int PGI_ORIENTATION_SOUTH
Initial plug orientation.

See Also:
Constant Field Values
Constructor Detail

PlugGUI

public PlugGUI()
Method Detail

getOrientaion

public int getOrientaion()
Returns plug orientation.


contains

public abstract boolean contains(int px,
                                 int py)
Tests, if point lies on the plug.

Parameters:
px - x-coordinate.
py - y-coordinate.
Returns:
Positive if the given point lies on the plug.

getToolTipText

public abstract java.lang.String getToolTipText()
Tooltip text for the plug.


getX

public abstract int getX()
Gets relative x-coordinate of the plug.


getY

public abstract int getY()
Gets relative y-coordinate of the plug.


movePlug

public abstract void movePlug(int nx,
                              int ny)
Moves the Plug.

Parameters:
nx - X-coordinate offset (relative coordinate).
ny - Y-coordinate offset (relative coordinate).

resize

public abstract void resize(int nx,
                            int ny)
The Plug's module was resized.

Parameters:
nx - New module width.
ny - New module height.

paintItem

public abstract void paintItem(java.awt.Graphics g)
Paint bonus graphics on module panel.