public class PolygonDrawPanel extends Object implements MouseMotionListener, MouseListener
Modifier and Type | Class and Description |
---|---|
class |
PolygonDrawPanel.KeyHandler |
Modifier and Type | Field and Description |
---|---|
protected boolean |
canResize |
static int |
CIRCLE_CURSOR |
static int |
DRAWING_ELLIPSE |
static int |
DRAWING_POLYGON |
static int |
DRAWING_RECT |
static int |
EAST |
protected Shape |
esborram |
protected HolesEditorPanel |
hep |
protected Rectangle |
lastPreviewArea |
static int |
MOVING |
static int |
NEW_POINT |
static int |
NO_RESIZING |
static int |
PEN_CURSOR |
static int |
SELECTING |
static int |
SOUTH |
static int |
SOUTH_EAST |
static int |
ZOOM |
Constructor and Description |
---|
PolygonDrawPanel(int width,
int height,
HolesEditorPanel hep,
boolean canResize)
Creates new PolygonDrawPanel
|
Modifier and Type | Method and Description |
---|---|
void |
addPointListener(PointListener listener) |
Point2D |
aproximationToDrawnBorder(double x,
double y) |
void |
cancelCurrentOperations() |
void |
clean() |
void |
convertToBezier() |
void |
convertToLine() |
void |
convertToQuad() |
void |
copy(boolean needSelected) |
void |
cut() |
void |
cut(double x,
double y) |
void |
deleteCurrent() |
void |
deleteSelected(boolean isCut) |
void |
deSelectAll() |
protected void |
deselectBorder() |
void |
drawGrid(Graphics g,
int gridWidth) |
void |
endPolygon() |
void |
endPolygon(boolean changeShape,
boolean updateList) |
void |
endPolygon(boolean changeShape,
boolean updateList,
int iNextShape) |
void |
endPolygon(ShapeData sd,
boolean changeShape,
boolean updateList,
int iNextShape) |
protected boolean |
esCantonada(double x,
double y) |
protected boolean |
esInterior(double x,
double y) |
protected boolean |
esSobreFigura(double x,
double y) |
List<GeneralPath> |
getGeneralPath() |
int |
getNumShapes() |
protected int |
getResizing(Point2D mousePoint) |
List<EditableShape> |
getSelectedShapes() |
ShapeData |
getShapeData() |
int |
getVisibleHeight() |
int |
getVisibleWidth() |
boolean |
hasSelectedDrawnShape(Point2D p) |
boolean |
hasSelectedPoint() |
void |
initDrawnBorders() |
void |
mouseClicked(MouseEvent mouseEvent) |
void |
mouseDragged(MouseEvent mouseEvent) |
void |
mouseEntered(MouseEvent mouseEvent) |
void |
mouseExited(MouseEvent mouseEvent) |
void |
mouseMoved(MouseEvent mouseEvent) |
void |
mousePressed(MouseEvent mouseEvent) |
void |
mouseReleased(MouseEvent mouseEvent) |
void |
move(int xInc,
int yInc,
boolean needSelected,
boolean moveAll) |
void |
notifyShapeChanged() |
void |
paint(Graphics2D g) |
protected void |
paintDrawnBorders(Graphics2D g) |
void |
paste() |
void |
paste(double x,
double y) |
protected void |
redrawingLines(double x,
double y) |
protected boolean |
removeNullLines(List<EditableShape> vRedrawingLines) |
void |
rotate(double theta,
boolean needSelected,
boolean rotateAll) |
void |
scale(double xInc,
double yInc,
boolean needSelected,
boolean scaleAll) |
protected void |
selectBorder(double x,
double y) |
boolean |
selectDrawnShape(Point2D p) |
void |
selectShape(int iIndex) |
void |
setDrawingMode(int drawingMode) |
protected void |
setResizingCursor(int resizing) |
void |
setShapeData(ShapeData sd,
double x,
double y,
double scaleX,
double scaleY) |
void |
undoLastMove(List<EditableShape> vRedrawingLines,
List<EditableShape> vRedrawingLinesBeforeModify) |
void |
updateView() |
public static final int SELECTING
public static final int MOVING
public static final int NEW_POINT
public static final int DRAWING_RECT
public static final int DRAWING_ELLIPSE
public static final int DRAWING_POLYGON
public static final int ZOOM
public static final int NO_RESIZING
public static final int EAST
public static final int SOUTH
public static final int SOUTH_EAST
protected HolesEditorPanel hep
protected boolean canResize
protected Rectangle lastPreviewArea
public static final int PEN_CURSOR
public static final int CIRCLE_CURSOR
protected Shape esborram
public PolygonDrawPanel(int width, int height, HolesEditorPanel hep, boolean canResize)
public void setDrawingMode(int drawingMode)
public int getVisibleWidth()
public int getVisibleHeight()
public void initDrawnBorders()
public void paint(Graphics2D g)
public void drawGrid(Graphics g, int gridWidth)
protected void paintDrawnBorders(Graphics2D g)
public void updateView()
public void setShapeData(ShapeData sd, double x, double y, double scaleX, double scaleY)
public void clean()
public boolean selectDrawnShape(Point2D p)
public void selectShape(int iIndex)
public Point2D aproximationToDrawnBorder(double x, double y)
protected void redrawingLines(double x, double y)
public void cancelCurrentOperations()
public void cut(double x, double y)
public void cut()
public void copy(boolean needSelected)
public void paste()
public void paste(double x, double y)
public void deSelectAll()
public List<GeneralPath> getGeneralPath()
public boolean hasSelectedDrawnShape(Point2D p)
public void deleteSelected(boolean isCut)
public boolean hasSelectedPoint()
public List<EditableShape> getSelectedShapes()
public int getNumShapes()
public void deleteCurrent()
public ShapeData getShapeData()
public void endPolygon()
public void endPolygon(boolean changeShape, boolean updateList)
public void endPolygon(boolean changeShape, boolean updateList, int iNextShape)
public void endPolygon(ShapeData sd, boolean changeShape, boolean updateList, int iNextShape)
public void move(int xInc, int yInc, boolean needSelected, boolean moveAll)
public void scale(double xInc, double yInc, boolean needSelected, boolean scaleAll)
public void rotate(double theta, boolean needSelected, boolean rotateAll)
public void convertToBezier()
public void convertToQuad()
public void convertToLine()
public void notifyShapeChanged()
public void addPointListener(PointListener listener)
public void undoLastMove(List<EditableShape> vRedrawingLines, List<EditableShape> vRedrawingLinesBeforeModify)
public void mouseDragged(MouseEvent mouseEvent)
mouseDragged
in interface MouseMotionListener
protected boolean esCantonada(double x, double y)
protected boolean esSobreFigura(double x, double y)
protected boolean esInterior(double x, double y)
public void mouseMoved(MouseEvent mouseEvent)
mouseMoved
in interface MouseMotionListener
protected int getResizing(Point2D mousePoint)
protected void setResizingCursor(int resizing)
protected void selectBorder(double x, double y)
protected void deselectBorder()
protected boolean removeNullLines(List<EditableShape> vRedrawingLines)
public void mouseClicked(MouseEvent mouseEvent)
mouseClicked
in interface MouseListener
public void mouseEntered(MouseEvent mouseEvent)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent mouseEvent)
mouseExited
in interface MouseListener
public void mousePressed(MouseEvent mouseEvent)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent mouseEvent)
mouseReleased
in interface MouseListener
Copyright © 2004-15 Francesc Busquets (fbusquets@xtec.cat) & Departament d'Educació de la Generalitat de Catalunya (info@xtec.cat)
Licensed under the terms of the GNU General Public License.