mascoptLib.gui.views
Class View

java.lang.Object
  |
  +--java.awt.Component
        |
        +--mascoptLib.gui.views.GObject
              |
              +--mascoptLib.gui.views.View
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
GView

public class View
extends GObject

A View.

Version:
Thu Mar 21 18:38:16 2002
Author:
bbongiov@bing.inria.fr
See Also:
Serialized Form

Field Summary
 Dimension preferredSize
          The default dimensions of a view.
 
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
View(int x, int y, double zoomFactor)
          Default constructor of a view.
 
Method Summary
 void addLayer(mascoptLib.gui.views.Layer layer)
          Add a layer in the view.
 boolean contains(mascoptLib.gui.views.Layer l)
          Say if this view contains this layer.
 Component getFirstComponentAt(Point p)
          Returns the components at a point p.
 int getLayerCount()
          Count the layers.
 int getLayerIndex(mascoptLib.gui.views.Layer l)
          Say at which level is a layer.
 mascoptLib.gui.views.LayerInfo getLayerInfo(mascoptLib.gui.views.Layer l)
          Get inforamtions about a layer.
 Dimension getPreferredSize()
          Get the default prefered size.
 Dimension getReal(Dimension dim)
          Internal calculus (?).
 Point getReal(Point p)
          Internal calculus (?).
 Rectangle getReal(Rectangle r)
          Internal calculus (?).
 Point getRealCenter()
          Return the center of the view.
 Dimension getView(Dimension dim)
          Internal calculus (?).
 Point getView(Point p)
          Internal calculus (?).
 Rectangle getView(Rectangle r)
          Internal calculus (?).
 double getZoom()
          Give the zoom factor.
 void insertLayer(int index, mascoptLib.gui.views.Layer layer)
          Insert a layer at this level.
 void insertLayerInfo(int index, mascoptLib.gui.views.LayerInfo li)
          Insert caracteristics of layers at this level.
 void paint(Graphics g)
          Paint the graphics.
 void removeLayer(mascoptLib.gui.views.Layer layer)
          Remove a layer in the view.
 void repaint()
          Repaint the view.
 void setDisplayMessage(String s)
          Display a message in the view.
 void setLocation(int x, int y)
          Set the location of the view.
 void setLocation(Point p)
          Set the location of the view.
 void setPreferredSize(Dimension dim)
          Set the default prefered size.
 void setPreferredSize(int x, int y)
          Set the default prefered size.
 void setRealCenter(Point p)
          Chagne the center of the view.
 void setVisibleLayer(mascoptLib.gui.views.Layer layer, boolean visible)
          Change the visibility of a layer in this view
 void setZoom(double newZoom)
          Set the zoom.
 void translate(int realX, int realY)
          Translate the view
 void translate(Point realPoint)
          Translate the view
 void updateZoom(double newZoom)
          Zoom with a factor.
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, 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, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

preferredSize

public Dimension preferredSize
The default dimensions of a view.

Constructor Detail

View

public View(int x,
            int y,
            double zoomFactor)
Default constructor of a view.

Parameters:
x - the width
y - the height
zoomFactor - the zoom factor
Method Detail

setLocation

public void setLocation(int x,
                        int y)
Set the location of the view.

Overrides:
setLocation in class Component
Parameters:
x - x
y - y

setLocation

public void setLocation(Point p)
Set the location of the view.

Overrides:
setLocation in class Component
Parameters:
p - the point to reach.

addLayer

public void addLayer(mascoptLib.gui.views.Layer layer)
Add a layer in the view.

Overrides:
addLayer in class GObject
Parameters:
layer - the layer to add.

removeLayer

public void removeLayer(mascoptLib.gui.views.Layer layer)
Remove a layer in the view.

Overrides:
removeLayer in class GObject
Parameters:
layer - the layer to remove

insertLayer

public void insertLayer(int index,
                        mascoptLib.gui.views.Layer layer)
Insert a layer at this level.

Parameters:
index - represents the level.
layer -

insertLayerInfo

public void insertLayerInfo(int index,
                            mascoptLib.gui.views.LayerInfo li)
Insert caracteristics of layers at this level.

Parameters:
index - the level.
li - the informations.

getLayerCount

public int getLayerCount()
Count the layers.

Returns:
the number of layers.

getLayerIndex

public int getLayerIndex(mascoptLib.gui.views.Layer l)
Say at which level is a layer.

Parameters:
l - the layer.
Returns:
the level.

contains

public boolean contains(mascoptLib.gui.views.Layer l)
Say if this view contains this layer.

Parameters:
l - the layer.
Returns:
true if the layer is in the view.

getLayerInfo

public mascoptLib.gui.views.LayerInfo getLayerInfo(mascoptLib.gui.views.Layer l)
Get inforamtions about a layer.

Parameters:
l - the layer
Returns:
the layer info

setVisibleLayer

public void setVisibleLayer(mascoptLib.gui.views.Layer layer,
                            boolean visible)
Change the visibility of a layer in this view

Parameters:
layer - the layer
visible - visible or not

getRealCenter

public Point getRealCenter()
Return the center of the view.

Returns:
a Point

setRealCenter

public void setRealCenter(Point p)
Chagne the center of the view.

Parameters:
p - the point.

translate

public void translate(int realX,
                      int realY)
Translate the view

Overrides:
translate in class GObject
Parameters:
realX - the x translation
realY - the y translation

translate

public void translate(Point realPoint)
Translate the view

Parameters:
realPoint - the point width/height

getZoom

public double getZoom()
Give the zoom factor.

Returns:
the zoom, a double.

setZoom

public void setZoom(double newZoom)
Set the zoom.

Parameters:
newZoom - the zoom factor, a double.

updateZoom

public void updateZoom(double newZoom)
Zoom with a factor. It multiplys the old zoom by this zoom.

Parameters:
newZoom - the zoom to multiply with.

getReal

public Point getReal(Point p)
Internal calculus (?).


getReal

public Dimension getReal(Dimension dim)
Internal calculus (?).


getReal

public Rectangle getReal(Rectangle r)
Internal calculus (?).


getView

public Point getView(Point p)
Internal calculus (?).


getView

public Dimension getView(Dimension dim)
Internal calculus (?).


getView

public Rectangle getView(Rectangle r)
Internal calculus (?).


repaint

public void repaint()
Repaint the view.

Overrides:
repaint in class GObject

setDisplayMessage

public void setDisplayMessage(String s)
Display a message in the view.

Parameters:
s - the string message.

getPreferredSize

public Dimension getPreferredSize()
Get the default prefered size.

Overrides:
getPreferredSize in class Component
Returns:
a Dimension.

setPreferredSize

public void setPreferredSize(int x,
                             int y)
Set the default prefered size.

Parameters:
x - width
y - height

setPreferredSize

public void setPreferredSize(Dimension dim)
Set the default prefered size.

Parameters:
dim - the Dimension

paint

public void paint(Graphics g)
Paint the graphics.

Overrides:
paint in class Component
Parameters:
g - the graphics.

getFirstComponentAt

public Component getFirstComponentAt(Point p)
Returns the components at a point p.

Parameters:
p - the point
Returns:
a Component.