|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.latexdraw.glib.handlers.Handler<T>
abstract class Handler<T extends java.awt.Shape>
A handler helps to manipulate and to delimit a shape view.
This file is part of LaTeXDraw
Copyright (c) 2005-2012 Arnaud BLOUIN
LaTeXDraw is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
LaTeXDraw is distributed without any warranty; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
08/28/11
Field Summary | |
---|---|
protected java.awt.Color |
colour
The colour of the handler. |
protected int |
opacity
The opacity of the delimiters. |
protected IPoint |
point
The coordinates of the centre of the delimiter. |
protected T |
shape
The shape of the handler. |
protected double |
size
The size of the handler. |
Fields inherited from interface net.sf.latexdraw.glib.handlers.IHandler |
---|
DEFAULT_SIZE |
Constructor Summary | |
---|---|
Handler()
Creates the handler. |
Method Summary | |
---|---|
boolean |
contains(double x,
double y)
Tests if the given point is into the pickable object. |
IPoint |
getCentre()
|
java.awt.Color |
getColour()
|
int |
getOpacity()
|
Picker |
getPicker()
|
double |
getSize()
|
double |
getX()
|
double |
getY()
|
void |
paint(java.awt.Graphics2D g)
paint the handler. |
void |
setOpacity(int opacity)
|
void |
setPoint(double x,
double y)
Changes the centre of the handler and updates the shape. |
void |
setSize(double size)
Sets the width of the handler and updates the shape. |
java.lang.String |
toString()
|
void |
update()
Updates the handler. |
void |
updateFromShape(java.awt.Shape sh)
Updates the handler using the given shape. |
protected abstract void |
updateShape()
Updates the Java2D shape of the handler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected IPoint point
protected double size
protected int opacity
protected java.awt.Color colour
protected T extends java.awt.Shape shape
Constructor Detail |
---|
public Handler()
Method Detail |
---|
public void setPoint(double x, double y)
setPoint
in interface IHandler
x
- The new X coordinate.y
- The new Y coordinate.public void setSize(double size)
setSize
in interface IHandler
size
- Its new width. Must be greater than 0.public double getX()
getX
in interface IHandler
public IPoint getCentre()
getCentre
in interface IHandler
public double getY()
getY
in interface IHandler
public void paint(java.awt.Graphics2D g)
paint
in interface IHandler
g
- The object into which objects are painted.public void update()
update
in interface IHandler
protected abstract void updateShape()
public java.lang.String toString()
toString
in class java.lang.Object
public double getSize()
getSize
in interface IHandler
public int getOpacity()
getOpacity
in interface IHandler
public void setOpacity(int opacity)
setOpacity
in interface IHandler
opacity
- the opacity to set.public java.awt.Color getColour()
getColour
in interface IHandler
public void updateFromShape(java.awt.Shape sh)
IHandler
updateFromShape
in interface IHandler
sh
- The shape used to updated the handler.public boolean contains(double x, double y)
Pickable
contains
in interface Pickable
x
- The x-coordinate of the point to test.y
- The y-coordinate of the point to test.
public Picker getPicker()
getPicker
in interface Pickable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |