[Nextobjects-devel] nextobjects/nextobjects/src/org/devaki/nextobjects/workspace/models/graphics Ass
Status: Alpha
Brought to you by:
eflorent
|
From: <efl...@us...> - 2003-06-02 20:03:50
|
Update of /cvsroot/nextobjects/nextobjects/nextobjects/src/org/devaki/nextobjects/workspace/models/graphics
In directory sc8-pr-cvs1:/tmp/cvs-serv28736/src/org/devaki/nextobjects/workspace/models/graphics
Modified Files:
AssociationLinkView.java ClassView.java ConceptualView.java
ConstraintView.java InheritanceLinkView.java PhysicalView.java
Log Message:
made model -> png about to work again + checkstyleS
Index: AssociationLinkView.java
===================================================================
RCS file: /cvsroot/nextobjects/nextobjects/nextobjects/src/org/devaki/nextobjects/workspace/models/graphics/AssociationLinkView.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** AssociationLinkView.java 31 May 2003 11:48:34 -0000 1.3
--- AssociationLinkView.java 2 Jun 2003 20:03:46 -0000 1.4
***************
*** 101,105 ****
public void paint(Graphics g)
{
! Point p0=((ConceptualView)this.myObject.getMyModel().getPanel()).jScrollPane.getViewport().getViewPosition();
Point p1=selectionPoints[0].getPoint();
--- 101,105 ----
public void paint(Graphics g)
{
! Point p0=myObject.getMyModel().getRectangle().getLocation();
Point p1=selectionPoints[0].getPoint();
Index: ClassView.java
===================================================================
RCS file: /cvsroot/nextobjects/nextobjects/nextobjects/src/org/devaki/nextobjects/workspace/models/graphics/ClassView.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ClassView.java 31 May 2003 11:48:34 -0000 1.9
--- ClassView.java 2 Jun 2003 20:03:46 -0000 1.10
***************
*** 53,57 ****
* old rectangle
*/
! public Rectangle oldRectangle = new Rectangle();
/**
--- 53,57 ----
* old rectangle
*/
! protected Rectangle oldRectangle = new Rectangle();
/**
Index: ConceptualView.java
===================================================================
RCS file: /cvsroot/nextobjects/nextobjects/nextobjects/src/org/devaki/nextobjects/workspace/models/graphics/ConceptualView.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** ConceptualView.java 31 May 2003 13:42:35 -0000 1.19
--- ConceptualView.java 2 Jun 2003 20:03:46 -0000 1.20
***************
*** 53,56 ****
--- 53,57 ----
import org.devaki.nextobjects.workspace.models.objects.Entity;
import org.devaki.nextobjects.workspace.models.objects.InheritanceLink;
+ import java.awt.Image;
/**
***************
*** 108,113 ****
* full drawing refresh
*/
! private boolean fullRefresh = true;
!
/**
* The buffered image
--- 109,114 ----
* full drawing refresh
*/
! private boolean fullRefresh = false;
!
/**
* The buffered image
***************
*** 129,133 ****
this.setLayout(new BorderLayout());
// Construct the drawing area
! this.drawingArea = new JPanel()
{
/**
--- 130,134 ----
this.setLayout(new BorderLayout());
// Construct the drawing area
! drawingArea = new JPanel()
{
/**
***************
*** 139,220 ****
update(g);
}
- public void update(Graphics g)
- {
- Graphics2D g2 = (Graphics2D) g;
- //super.paint(g); // blank fill, clean ...
- super.paintComponent(g2);
- Rectangle area;
! BufferedImage bi2;
Graphics2D big;
Graphics2D bi2g;
! if (fullRefresh)
! {
! // collect our objects.
! BaseObject[] tmp = myModel.getModel0bjects();
! Rectangle rect = jScrollPane.getViewportBorderBounds();
! bi =
! (BufferedImage) drawingArea.createImage(
! rect.width,
! rect.height);
! big = bi.createGraphics();
! big.setColor(Color.WHITE);
! big.fillRect(0, 0, rect.width, rect.height);
! for (int k = 0; k < tmp.length; k++)
! {
! // Clears the rectangle that was previously drawn.
! Dimension d = tmp[k].getObjectView().getSize();
! Point l = tmp[k].getObjectView().getLocation();
! if (tmp[k].getObjectView() instanceof LineView)
{
! tmp[k].getObjectView().paint(big);
! } else
! { // classview ?!
! if (d.height > 0 && d.width > 0)
! {
! bi2 =
! (BufferedImage) drawingArea.createImage(
! d.width,
! d.height);
! bi2g = bi2.createGraphics();
! tmp[k].getObjectView().paint(bi2g);
! big.drawImage(
! bi2,
! l.x
! - ((int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getX()),
! l.y
! - ((int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getY()),
! this);
! }
}
}
- fullRefresh = false;
}
! if (bi != null)
{
! g2.drawImage(
! bi,
! (int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getX(),
! (int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getY(),
! this);
}
// loop/paint selected objects objects toviewPort panel.
for (int j = 0; j < ModelMan.getCurrentObjects().size(); j++)
--- 140,209 ----
update(g);
}
! public Image makeImage(int x,int y)
! {
! // collect our objects.
Graphics2D big;
+ BufferedImage bi2;
Graphics2D bi2g;
! BaseObject[] tmp = myModel.getModel0bjects();
! Rectangle rect;
! myModel.calculateRectangle();
! rect = myModel.getRectangle();
!
!
! bi=(BufferedImage) drawingArea.createImage(rect.width,rect.height);
! big = bi.createGraphics();
! big.setColor(CstGraphics.MODEL_BACKGROUND_COLOR);
! big.fillRect(0, 0, rect.width, rect.height);
! for (int k = 0; k < tmp.length; k++)
! {
! // Clears the rectangle that was previously drawn.
! Dimension d = tmp[k].getObjectView().getSize();
! Point l = tmp[k].getObjectView().getLocation();
!
! if (tmp[k].getObjectView() instanceof LineView)
! {
! tmp[k].getObjectView().paint(big);
! } else
! { // classview ?!
! if (d.height > 0 && d.width > 0)
{
! bi2 =(BufferedImage)drawingArea.createImage(d.width,d.height);
! bi2g = bi2.createGraphics();
! tmp[k].getObjectView().paint(bi2g);
! big.drawImage(
! bi2,
! l.x - myModel.getRectangle().x,
! l.y - myModel.getRectangle().y,
! this);
}
}
}
! return bi;
! }
!
! public void update(Graphics g)
! {
! Graphics2D g2 = (Graphics2D) g;
! // blank fill, clean ...
! super.paintComponent(g2);
! //Rectangle area;
! BufferedImage bi2;
! Graphics2D bi2g;
!
! if (fullRefresh)
{
! bi = (BufferedImage) makeImage(myModel.getRectangle().height,myModel.getRectangle().width);
! fullRefresh = false;
}
+ g2.drawImage(bi,myModel.getRectangle().x, myModel.getRectangle().y,this);
+
// loop/paint selected objects objects toviewPort panel.
for (int j = 0; j < ModelMan.getCurrentObjects().size(); j++)
***************
*** 230,241 ****
if (tmpObjectView instanceof ClassView)
{
! g2.setColor(Color.WHITE);
! Rectangle r =
! ((ClassView) tmpObjectView).getOldrectangle();
g2.fillRect(r.x, r.y, r.width, r.height);
! bi2 =
! (BufferedImage) drawingArea.createImage(
! d2.width,
! d2.height);
bi2g = bi2.createGraphics();
tmpObjectView.paint(bi2g);
--- 219,226 ----
if (tmpObjectView instanceof ClassView)
{
! g2.setColor(CstGraphics.MODEL_BACKGROUND_COLOR);
! Rectangle r =((ClassView) tmpObjectView).getOldrectangle();
g2.fillRect(r.x, r.y, r.width, r.height);
! bi2 =(BufferedImage) jScrollPane.createImage( d2.width, d2.height);
bi2g = bi2.createGraphics();
tmpObjectView.paint(bi2g);
***************
*** 250,283 ****
} else
{
!
! Graphics tmpClip =
! g2.create(
! ((int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getX()),
! ((int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getY()),
! ((int) jScrollPane
! .getViewport()
! .getViewSize()
! .width),
! ((int) jScrollPane
! .getViewport()
! .getViewSize()
! .height));
!
! ((BaseObject) ModelMan
! .getCurrentObjects()
! .elementAt(j))
! .getObjectView()
! .paint(
! tmpClip);
}
! ((BaseObject) ModelMan.getCurrentObjects().elementAt(j))
! .getObjectView()
! .renderSelected(g);
}
}
--- 235,245 ----
} else
{
! Graphics tmpClip =g2.create(myModel.getRectangle().x,
! myModel.getRectangle().y,
! getViewSize().width,
! getViewSize().height);
! ((BaseObject) ModelMan.getCurrentObjects().elementAt(j)).getObjectView().paint(tmpClip);
}
! ((BaseObject) ModelMan.getCurrentObjects().elementAt(j)).getObjectView().renderSelected(g);
}
}
***************
*** 287,296 ****
this.drawingArea.setPreferredSize(CstGraphics.MODEL_DIMENSION);
! /** Listeners **/
// Mouse Listeners
this.drawingArea.addMouseListener(new MyMouseListener());
this.drawingArea.addMouseMotionListener(new MyMouseMotionListener());
! /** Assembling components **/
this.jScrollPane = new JScrollPane(this.drawingArea);
jScrollPane.getViewport().setBackground(
--- 249,258 ----
this.drawingArea.setPreferredSize(CstGraphics.MODEL_DIMENSION);
! /* Listeners **/
// Mouse Listeners
this.drawingArea.addMouseListener(new MyMouseListener());
this.drawingArea.addMouseMotionListener(new MyMouseMotionListener());
! /* Assembling components **/
this.jScrollPane = new JScrollPane(this.drawingArea);
jScrollPane.getViewport().setBackground(
***************
*** 299,302 ****
--- 261,265 ----
//will update the buffered image in case viewport have changed.
+ // used at least at init
this.jScrollPane.getViewport().addChangeListener(new ChangeListener()
{
***************
*** 306,310 ****
}
});
-
/** Extra **/
// Initialize scrolling position
--- 269,272 ----
***************
*** 313,316 ****
--- 275,279 ----
}
+
/**
* Manage the drawing of an AssociationLink (Drag'n Drop operations)
***************
*** 528,531 ****
--- 491,495 ----
{
fullRefresh = true;
+ myModel.calculateRectangle();
x2 = e.getX();
y2 = e.getY();
***************
*** 823,827 ****
{
// Draw a line between the currently dragged object
! ptrGphx2D.setColor(Color.WHITE);
ptrGphx2D.fillRect(
Math.min(x1, x2),
--- 787,791 ----
{
// Draw a line between the currently dragged object
! ptrGphx2D.setColor(CstGraphics.MODEL_BACKGROUND_COLOR);
ptrGphx2D.fillRect(
Math.min(x1, x2),
***************
*** 842,855 ****
x2
+ e.getComponent().getX()
! + (int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getX(),
y2
+ e.getComponent().getY()
! + (int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getY()))
{
// Verify that the targeted object is not equal to the dragged
--- 806,813 ----
x2
+ e.getComponent().getX()
! + getViewPosition().x,
y2
+ e.getComponent().getY()
! + getViewPosition().y))
{
// Verify that the targeted object is not equal to the dragged
***************
*** 880,895 ****
.getSurface()
.contains(
! x2
! + e.getComponent().getX()
! + (int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getX(),
! y2
! + e.getComponent().getY()
! + (int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getY()))
{
// Verify that the targeted object is not equal to the dragged
--- 838,844 ----
.getSurface()
.contains(
! x2+ e.getComponent().getX()
! + getViewPosition().x,
! y2+e.getComponent().getY()+getViewPosition().y))
{
// Verify that the targeted object is not equal to the dragged
***************
*** 973,978 ****
}
}
-
}
}
--- 922,980 ----
}
}
}
+ }
+
+
+
+ /**
+ * Set if to refresh the drawing at next paint
+ * @param b full refresh
+ */
+ public void setFullRefresh(boolean b)
+ {
+ fullRefresh = b;
+ }
+
+ /**
+ * Location of the view position
+ * @return the point
+ */
+ public Point getViewPosition()
+ {
+ return jScrollPane.getViewport().getViewPosition();
+ }
+
+ /**
+ * return the view size
+ * @return the location
+ */
+ public Dimension getViewSize()
+ {
+ return jScrollPane.getViewport().getViewSize();
+ }
+
+ /**
+ * Set the view position
+ * @param point the location
+ */
+ public void setViewPosition(Point point)
+ {
+ jScrollPane.getViewport().setViewPosition(point);
+ }
+ /**
+ * Get the visible rectangle
+ * @return the rectangle
+ */
+ public Rectangle getViewRect()
+ {
+ return jScrollPane.getViewport().getViewRect();
+ }
+ /**
+ * set the dimension
+ * @param d the dimension
+ */
+ public void setViewSize(Dimension d)
+ {
+ jScrollPane.getViewport().setViewSize(d);
}
Index: ConstraintView.java
===================================================================
RCS file: /cvsroot/nextobjects/nextobjects/nextobjects/src/org/devaki/nextobjects/workspace/models/graphics/ConstraintView.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ConstraintView.java 31 May 2003 11:48:34 -0000 1.7
--- ConstraintView.java 2 Jun 2003 20:03:46 -0000 1.8
***************
*** 76,80 ****
{
! Point p0=((PhysicalView)this.myObject.getMyModel().getPanel()).jScrollPane.getViewport().getViewPosition();
Point p1=selectionPoints[0].getPoint();
--- 76,80 ----
{
! Point p0=this.myObject.getMyModel().getRectangle().getLocation();
Point p1=selectionPoints[0].getPoint();
Index: InheritanceLinkView.java
===================================================================
RCS file: /cvsroot/nextobjects/nextobjects/nextobjects/src/org/devaki/nextobjects/workspace/models/graphics/InheritanceLinkView.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** InheritanceLinkView.java 31 May 2003 11:48:34 -0000 1.6
--- InheritanceLinkView.java 2 Jun 2003 20:03:46 -0000 1.7
***************
*** 68,76 ****
{
! Point p0 =
! ((ConceptualView) this.myObject.getMyModel().getPanel())
! .jScrollPane
! .getViewport()
! .getViewPosition();
Point p1 = selectionPoints[0].getPoint();
--- 68,72 ----
{
! Point p0 =myObject.getMyModel().getRectangle().getLocation();
Point p1 = selectionPoints[0].getPoint();
***************
*** 87,91 ****
g.setColor(this.myStyle.getLineColor());
! // calculate parralle lines
double angle = Math.atan2(y2 - y1, x2 - x1) + Math.PI;
int x5 = (int) (x1 + Math.cos(angle - theta) * size / 2);
--- 83,87 ----
g.setColor(this.myStyle.getLineColor());
! // calculate parrallels
double angle = Math.atan2(y2 - y1, x2 - x1) + Math.PI;
int x5 = (int) (x1 + Math.cos(angle - theta) * size / 2);
***************
*** 103,107 ****
// calculate points for arrowhead
-
x3 = (int) (x2 + Math.cos(angle - theta) * size);
y3 = (int) (y2 + Math.sin(angle - theta) * size);
--- 99,102 ----
Index: PhysicalView.java
===================================================================
RCS file: /cvsroot/nextobjects/nextobjects/nextobjects/src/org/devaki/nextobjects/workspace/models/graphics/PhysicalView.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** PhysicalView.java 31 May 2003 13:42:35 -0000 1.18
--- PhysicalView.java 2 Jun 2003 20:03:46 -0000 1.19
***************
*** 54,57 ****
--- 54,58 ----
import org.devaki.nextobjects.workspace.models.objects.InheritanceLink;
+
/**
* Main class for drawing Physical Data Models
***************
*** 96,100 ****
* the context model
*/
! transient private PhysicalModel myModel;
/**
--- 97,101 ----
* the context model
*/
! private PhysicalModel myModel;
/**
***************
*** 134,158 ****
drawingArea = new JPanel()
{
! public void paint(Graphics g)
! {
! update(g);
! }
! public void update(Graphics g)
! {
! Rectangle area;
! BufferedImage bi2;
! Graphics2D big;
! Graphics2D bi2g;
!
! Graphics2D g2 = (Graphics2D) g;
! //super.paint(g); // blank fill, clean ...
! super.paintComponent(g2);
! if (fullRefresh)
{
// collect our objects.
BaseObject[] tmp = myModel.getModel0bjects();
! Rectangle rect = jScrollPane.getViewportBorderBounds();
bi =
(BufferedImage) drawingArea.createImage(
--- 135,160 ----
drawingArea = new JPanel()
{
! /**
! * Draw all components
! * @param g the graphics
! */
! public void paint(Graphics g)
! {
! update(g);
! }
! public BufferedImage getImage()
{
// collect our objects.
+ Graphics2D big;
+ BufferedImage bi2;
+ Graphics2D bi2g;
+
BaseObject[] tmp = myModel.getModel0bjects();
! Rectangle rect;
! myModel.calculateRectangle();
! rect = myModel.getRectangle();
!
bi =
(BufferedImage) drawingArea.createImage(
***************
*** 161,165 ****
big = bi.createGraphics();
! big.setColor(Color.WHITE);
big.fillRect(0, 0, rect.width, rect.height);
--- 163,167 ----
big = bi.createGraphics();
! big.setColor(CstGraphics.MODEL_BACKGROUND_COLOR);
big.fillRect(0, 0, rect.width, rect.height);
***************
*** 185,284 ****
big.drawImage(
bi2,
! l.x
! - ((int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getX()),
! l.y
! - ((int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getY()),
this);
}
}
}
! fullRefresh = false;
! }
! if (bi != null)
! {
! g2.drawImage(
! bi,
! (int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getX(),
! (int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getY(),
! this);
}
! // loop/paint selected objects objects toviewPort panel.
! for (int j = 0; j < ModelMan.getCurrentObjects().size(); j++)
{
! ObjectView tmpObjectView =
! ((BaseObject) ModelMan
! .getCurrentObjects()
! .elementAt(j))
! .getObjectView();
! Dimension d2 = tmpObjectView.getSize();
! Point p2 = tmpObjectView.getLocation();
! if (tmpObjectView instanceof ClassView)
{
! g2.setColor(Color.WHITE);
! Rectangle r =
! ((ClassView) tmpObjectView).getOldrectangle();
! g2.fillRect(r.x, r.y, r.width, r.height);
! bi2 =
! (BufferedImage) drawingArea.createImage(
! d2.width,
! d2.height);
! bi2g = bi2.createGraphics();
! tmpObjectView.paint(bi2g);
! ((BaseObject) ModelMan
! .getCurrentObjects()
! .elementAt(j))
! .getObjectView()
! .paint(
! bi2g);
! g2.drawImage(bi2, p2.x, p2.y, this);
! } else
{
! Graphics tmpClip =
! g2.create(
! ((int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getX()),
! ((int) jScrollPane
! .getViewport()
! .getViewPosition()
! .getY()),
! ((int) jScrollPane
! .getViewport()
! .getViewSize()
! .width),
! ((int) jScrollPane
! .getViewport()
! .getViewSize()
! .height));
! ((BaseObject) ModelMan
! .getCurrentObjects()
! .elementAt(j))
! .getObjectView()
! .paint(
! tmpClip);
}
- ((BaseObject) ModelMan.getCurrentObjects().elementAt(j))
- .getObjectView()
- .renderSelected(g);
}
- }
-
};
// Define the color of the background
--- 187,262 ----
big.drawImage(
bi2,
! l.x - myModel.getRectangle().x,
! l.y - myModel.getRectangle().y,
this);
}
}
}
! return bi;
}
!
! public void update(Graphics g)
{
! Graphics2D g2 = (Graphics2D) g;
! // blank fill, clean ...
! super.paintComponent(g2);
! Rectangle area;
! BufferedImage bi2;
! Graphics2D bi2g;
! if (fullRefresh)
{
! bi = getImage();
! fullRefresh = false;
! }
! int a=myModel.getRectangle().x;
! int b=myModel.getRectangle().y;
! Point p=new Point(a,b);
! g2.drawImage(bi,p.x, p.y,this);
!
!
! // loop/paint selected objects objects toviewPort panel.
! for (int j = 0; j < ModelMan.getCurrentObjects().size(); j++)
{
+ ObjectView tmpObjectView =
+ ((BaseObject) ModelMan
+ .getCurrentObjects()
+ .elementAt(j))
+ .getObjectView();
+ Dimension d2 = tmpObjectView.getSize();
+ Point p2 = tmpObjectView.getLocation();
! if (tmpObjectView instanceof ClassView)
! {
! g2.setColor(CstGraphics.MODEL_BACKGROUND_COLOR);
! Rectangle r =
! ((ClassView) tmpObjectView).getOldrectangle();
! g2.fillRect(r.x, r.y, r.width, r.height);
! bi2 =
! (BufferedImage) drawingArea.createImage(
! d2.width,
! d2.height);
! bi2g = bi2.createGraphics();
! tmpObjectView.paint(bi2g);
! ((BaseObject) ModelMan
! .getCurrentObjects()
! .elementAt(j))
! .getObjectView()
! .paint(
! bi2g);
! g2.drawImage(bi2, p2.x, p2.y, this);
! } else
! {
! Graphics tmpClip =g2.create(p.x,
! p.y,
! getViewSize().width,
! getViewSize().height);
! ((BaseObject) ModelMan.getCurrentObjects().elementAt(j)).getObjectView().paint(tmpClip);
! }
! ((BaseObject) ModelMan.getCurrentObjects().elementAt(j)).getObjectView().renderSelected(g);
}
}
};
// Define the color of the background
***************
*** 286,299 ****
this.drawingArea.setPreferredSize(CstGraphics.MODEL_DIMENSION);
- /** Listeners **/
// Mouse Listeners
this.drawingArea.addMouseListener(new MyMouseListener());
this.drawingArea.addMouseMotionListener(new MyMouseMotionListener());
! /** Assembling components **/
this.jScrollPane = new JScrollPane(this.drawingArea);
this.add(jScrollPane, BorderLayout.CENTER);
- /** Extra **/
// Initialize scrolling position
jScrollPane.getViewport().setViewPosition(
--- 264,275 ----
this.drawingArea.setPreferredSize(CstGraphics.MODEL_DIMENSION);
// Mouse Listeners
this.drawingArea.addMouseListener(new MyMouseListener());
this.drawingArea.addMouseMotionListener(new MyMouseMotionListener());
! // Assembling components
this.jScrollPane = new JScrollPane(this.drawingArea);
this.add(jScrollPane, BorderLayout.CENTER);
// Initialize scrolling position
jScrollPane.getViewport().setViewPosition(
***************
*** 431,435 ****
newInheritanceLink);
}
- repaint();
}
}
--- 407,410 ----
***************
*** 437,440 ****
--- 412,416 ----
ModelMan.setDraggedObject(null);
ModelMan.setDropTargetObject(null);
+ drawingArea.repaint();
}
***************
*** 544,547 ****
--- 520,524 ----
{
fullRefresh = true;
+ myModel.calculateRectangle();
x2 = e.getX();
y2 = e.getY();
***************
*** 846,850 ****
{
// Draw a line between the currently dragged object
! ptrGphx2D.setColor(Color.WHITE);
ptrGphx2D.fillRect(
Math.min(x1, x2),
--- 823,827 ----
{
// Draw a line between the currently dragged object
! ptrGphx2D.setColor(CstGraphics.MODEL_BACKGROUND_COLOR);
ptrGphx2D.fillRect(
Math.min(x1, x2),
***************
*** 880,895 ****
}
// Refresh the drawing area
! if (ModelMan.getCurrentObject() != null)
! {
! // this could be set somewhere else.
! ptrGphx2D.setClip(jScrollPane.getViewport().getViewRect());
! for (int i = 0; i < ModelMan.getCurrentObjects().size(); i++)
! {
! ((BaseObject) ModelMan.getCurrentObjects().elementAt(i))
! .getObjectView()
! .paint(
! ptrGphx2D);
! }
! }
}
--- 857,861 ----
}
// Refresh the drawing area
! drawingArea.repaint();
}
***************
*** 948,950 ****
--- 914,935 ----
}
}
+
+
+ /**
+ * set if refresh rectangle / drawing
+ * @param b refresh
+ */
+ public void setFullRefresh(boolean b)
+ {
+ fullRefresh = b;
+ }
+ /**
+ * return the view size
+ * @return the location
+ */
+ public Dimension getViewSize()
+ {
+ return jScrollPane.getViewport().getViewSize();
+ }
+
}
|