Commit b2da72c5 authored by Serge Leblanc's avatar Serge Leblanc
Browse files

changed protected size variable

parent cf455eb2
/** /**
* *
*$Id: FCPortView.java,v 1.3 2002-09-13 17:53:56 serge Exp $ *$Id: FCPortView.java,v 1.4 2002-12-01 22:40:50 serge Exp $
* *
* Transmorpher * Transmorpher
* *
...@@ -50,7 +50,7 @@ public class FCPortView extends PortView{ ...@@ -50,7 +50,7 @@ public class FCPortView extends PortView{
/** Instanciation of the renderer. */ /** Instanciation of the renderer. */
protected CellViewRenderer renderer = new FCPortRenderer(); protected CellViewRenderer renderer = new FCPortRenderer();
protected int size = 10; protected int glyphSize = 10;
/** Constructs the view. /** Constructs the view.
* @param cell the ApplyRulesetCell Object * @param cell the ApplyRulesetCell Object
...@@ -61,40 +61,15 @@ public class FCPortView extends PortView{ ...@@ -61,40 +61,15 @@ public class FCPortView extends PortView{
super(cell, graph, mapper); super(cell, graph, mapper);
} }
/**
* Change the size of the port.
*
* @param size a int which define the new size.
* If <code>size</code>< 5 then the size is set to 5.
*/
public void setSize(int size) {
if (size<5) {
this.size=5;
}
else {
this.size = size;
}
}
/**
* Return the actual size of the port view.
*
* @return size
*/
public int getSize() {
return size;
}
/** /**
* Returns the bounds for the port view. * Returns the bounds for the port view.
*/ */
public Rectangle getBounds() { public Rectangle getBounds() {
Rectangle bounds = new Rectangle(getLocation(null)); Rectangle bounds = new Rectangle(getLocation(null));
bounds.x = bounds.x-size/2; bounds.x = bounds.x-glyphSize/2;
bounds.y = bounds.y-size/2; bounds.y = bounds.y-glyphSize/2;
bounds.width = bounds.width + size; bounds.width = bounds.width + glyphSize;
bounds.height = bounds.height + size; bounds.height = bounds.height + glyphSize;
return bounds; return bounds;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment