[Spedit-commits] CVS: prototype/Sources/net/sourceforge/spedit/ui AttributesDisplay.java,1.6,1.7 Par
Status: Planning
Brought to you by:
krunte
|
From: S?bastien P. <kaz...@us...> - 2001-12-05 16:28:47
|
Update of /cvsroot/spedit/prototype/Sources/net/sourceforge/spedit/ui
In directory usw-pr-cvs1:/tmp/cvs-serv13979/net/sourceforge/spedit/ui
Modified Files:
AttributesDisplay.java ParagraphView.java WrapperView.java
Log Message:
Fixed a bug in the removal, but there are still some others. The
current implementation seems to be weak and crashes sometimes. Event
firing has been improved in XMLElementWrapper, in order for the events
to be fired only after the element has gained a stable state, ie. that
the actual modifications have been taken into effect.
Index: AttributesDisplay.java
===================================================================
RCS file: /cvsroot/spedit/prototype/Sources/net/sourceforge/spedit/ui/AttributesDisplay.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** AttributesDisplay.java 2001/12/04 16:37:29 1.6
--- AttributesDisplay.java 2001/12/05 16:28:44 1.7
***************
*** 76,82 ****
this.view = view;
this.element = element;
- //This seems strange but this actually fetches the DocumentFrame ;)
- // JEditorPane->JViewPort->JScrollPane->JSplitBar->JPanel->JLayeredPane->JRootPane->DocumentFrame
- //addMouseListener((MouseListener)view.getContainer().getParent().getParent().getParent().getParent().getParent().getParent().getParent());
setFont(view.getStyleSheet().font);
}
--- 76,79 ----
***************
*** 128,132 ****
else
{
! return element.getXMLElement().getAttributes().size();;
}
--- 125,129 ----
else
{
! return element.getXMLElement().getAttributes().size();
}
Index: ParagraphView.java
===================================================================
RCS file: /cvsroot/spedit/prototype/Sources/net/sourceforge/spedit/ui/ParagraphView.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ParagraphView.java 2001/11/28 13:14:37 1.4
--- ParagraphView.java 2001/12/05 16:28:44 1.5
***************
*** 73,81 ****
--- 73,92 ----
public void paint(Graphics g, Shape bounds)
{
+ //System.out.println(">>Painting paragraph name:"+getElement().getName()+" from offset"+
+ //getStartOffset()+" to "+getEndOffset());
int off = getStartOffset();
+ try
+ {
Shape shape = getParent().getChildAllocation(getViewIndex(off,
Position.Bias.Forward),bounds);
super.paint(g,bounds);
+ }
+ catch (Exception e)
+ {
+ System.out.println(">>Painting paragraph name:"+getElement().getName()+" from offset"+
+ getStartOffset()+" to "+getEndOffset());
+ System.out.println(" element has parent : "+getElement().getParentElement());
+ }
}
Index: WrapperView.java
===================================================================
RCS file: /cvsroot/spedit/prototype/Sources/net/sourceforge/spedit/ui/WrapperView.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** WrapperView.java 2001/12/04 16:37:30 1.6
--- WrapperView.java 2001/12/05 16:28:44 1.7
***************
*** 518,521 ****
--- 518,522 ----
public int viewToModel(float x, float y, Shape a, Position.Bias[] biasReturn)
{
+ System.out.println("Element :"+getElement().getName()+" start:"+getStartOffset()+" end:"+getEndOffset());
return nested.viewToModel(x-getLeftInset(styleSheet),
y-getTopInset(styleSheet),a,biasReturn);
***************
*** 955,958 ****
--- 956,965 ----
{ return nested.getElement().getName(); }
+ protected void updateLayout(DocumentEvent.ElementChange ec, DocumentEvent e, Shape a)
+ {
+ refreshBounds=true;
+ super.updateLayout(ec, e, a);
+ }
+
//-------------------------------------------------------------------------
//
|