summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/graph/view/GraphPanel.java
diff options
context:
space:
mode:
Diffstat (limited to 'source/com/c2kernel/graph/view/GraphPanel.java')
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/graph/view/GraphPanel.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/source/com/c2kernel/graph/view/GraphPanel.java b/source/com/c2kernel/graph/view/GraphPanel.java
index 9db481e..5edd070 100755..100644
--- a/source/com/c2kernel/graph/view/GraphPanel.java
+++ b/source/com/c2kernel/graph/view/GraphPanel.java
@@ -41,6 +41,7 @@ public class GraphPanel extends JPanel implements Observer
// is pressed on the graph panel
addMouseListener(new MouseAdapter()
{
+ @Override
public void mousePressed(MouseEvent me)
{
requestFocus();
@@ -51,6 +52,7 @@ public class GraphPanel extends JPanel implements Observer
{
mGraphModelManager = graphModelManager;
}
+ @Override
public void update(Observable o, Object arg)
{
if (arg instanceof GraphModelResizedEvent || arg instanceof EntireModelChangedEvent)
@@ -60,6 +62,7 @@ public class GraphPanel extends JPanel implements Observer
}
repaint();
}
+ @Override
public void paintComponent(Graphics g)
{
Graphics2D g2d = (Graphics2D) g;
@@ -111,7 +114,7 @@ public class GraphPanel extends JPanel implements Observer
drawVertexHighlight(g2d, selection.mVertices[i], 5);
}
// Draw the resize pads if there is one and only one vertex selected
- if (selection.mVertices.length == 1 &&
+ if (selection.mVertices.length == 1 &&
selection.mVertices[0] != mGraphModelManager.getModel().getContainingVertex())
{
vertexCentre = selection.mVertices[0].getCentrePoint();
@@ -189,7 +192,7 @@ public class GraphPanel extends JPanel implements Observer
outlinePoints[0].y);
}
// Draws the specifed line the specified distance away from the specified centre point
- private void drawShiftedLine(int dist, Graphics2D g2d, GraphPoint centrePoint, int x1, int y1, int x2, int y2)
+ private static void drawShiftedLine(int dist, Graphics2D g2d, GraphPoint centrePoint, int x1, int y1, int x2, int y2)
{
if (x1 > centrePoint.x)
x1 += dist;
@@ -225,6 +228,7 @@ public class GraphPanel extends JPanel implements Observer
g2d.drawLine(maxX, maxY, minX, maxY);
g2d.drawLine(minX, maxY, minX, minY);
}
+ @Override
public void printComponent(Graphics g)
{
super.paintComponent(g);
@@ -232,12 +236,6 @@ public class GraphPanel extends JPanel implements Observer
DirectedEdge[] edges = null;
Vertex[] vertices = null;
Vertex startVertex = null;
- Selection selection = null;
- ElasticBand elasticBand = null;
- Vertex newEdgeOriginVertex = null;
- GraphPoint newEdgeOriginPoint = null;
- Point newEdgeEndPoint = null;
- GraphPoint vertexCentre = null;
int i = 0;
g.setColor(Color.white);
g2d.fillRect(0,0,getWidth(),getHeight());
@@ -266,7 +264,7 @@ public class GraphPanel extends JPanel implements Observer
}
}
}
-
+
protected void superPaint(Graphics g)
{
super.paintComponent(g);