bprocessor-commit Mailing List for B-processor (Page 144)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael L. <he...@us...> - 2006-01-04 14:30:17
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21783/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java PasteActionListener.java ShiftActionListener.java ExtrusionTool.java DomainPopupListener.java CreateSpaceActionListener.java Log Message: Replaced created/remove/modified from Notifier with changed/update Index: CreateSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CreateSpaceActionListener.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CreateSpaceActionListener.java 12 Dec 2005 20:19:54 -0000 1.4 --- CreateSpaceActionListener.java 4 Jan 2006 14:29:50 -0000 1.5 *************** *** 89,95 **** } space.addSurface(surface); ! Project.getInstance().update(space); if (old != null) { ! Project.getInstance().update(old); } } --- 89,95 ---- } space.addSurface(surface); ! space.changed(); if (old != null) { ! old.changed(); } } Index: PasteActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PasteActionListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PasteActionListener.java 11 Dec 2005 17:50:58 -0000 1.3 --- PasteActionListener.java 4 Jan 2006 14:29:50 -0000 1.4 *************** *** 9,17 **** import java.awt.event.ActionEvent; import java.awt.event.ActionListener; - import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; - import net.sourceforge.bprocessor.model.Project; import org.apache.log4j.Logger; --- 9,15 ---- *************** *** 58,69 **** surface.setFrontDomain(nonFacing); } ! Project.getInstance().update(surface); if (facing != null) { facing.addSurface(surface); ! Project.getInstance().update(facing); } if (nonFacing != null) { nonFacing.addSurface(surface); ! Project.getInstance().update(nonFacing); } } --- 56,67 ---- surface.setFrontDomain(nonFacing); } ! surface.changed(); if (facing != null) { facing.addSurface(surface); ! facing.changed(); } if (nonFacing != null) { nonFacing.addSurface(surface); ! nonFacing.changed(); } } Index: DomainPopupListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/DomainPopupListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DomainPopupListener.java 11 Dec 2005 17:50:58 -0000 1.3 --- DomainPopupListener.java 4 Jan 2006 14:29:50 -0000 1.4 *************** *** 9,15 **** import java.awt.event.ActionEvent; import java.awt.event.ActionListener; - - - import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; --- 9,12 ---- *************** *** 58,62 **** } if (oldFront != null) { ! Project.getInstance().update(oldFront); } } else { --- 55,59 ---- } if (oldFront != null) { ! oldFront.changed(); } } else { *************** *** 67,78 **** } if (oldBack != null) { ! Project.getInstance().update(oldBack); } } if (domain != null) { ! Project.getInstance().update(domain); } ! ! Project.getInstance().update(surface); } } --- 64,74 ---- } if (oldBack != null) { ! oldBack.changed(); } } if (domain != null) { ! domain.changed(); } ! surface.changed(); } } Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ExtrusionTool.java 20 Dec 2005 13:55:51 -0000 1.36 --- ExtrusionTool.java 4 Jan 2006 14:29:50 -0000 1.37 *************** *** 384,388 **** Surface hole = createSurface(edges); surface.addHole(hole); ! Project.getInstance().update(surface); } } --- 384,388 ---- Surface hole = createSurface(edges); surface.addHole(hole); ! surface.changed(); } } *************** *** 478,485 **** Surface surf = (Surface)surfIt.next(); surf.setBackDomain(back); ! Project.getInstance().update(surf); if (back != null) { back.addSurface(surf); ! Project.getInstance().update(back); } } --- 478,485 ---- Surface surf = (Surface)surfIt.next(); surf.setBackDomain(back); ! surf.changed(); if (back != null) { back.addSurface(surf); ! back.changed(); } } *************** *** 495,502 **** Surface surf = (Surface)surfIt.next(); surf.setFrontDomain(front); ! Project.getInstance().update(surf); if (front != null) { front.addSurface(surf); ! Project.getInstance().update(front); } } --- 495,502 ---- Surface surf = (Surface)surfIt.next(); surf.setFrontDomain(front); ! surf.changed(); if (front != null) { front.addSurface(surf); ! front.changed(); } } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** AbstractTool.java 29 Dec 2005 15:06:48 -0000 1.45 --- AbstractTool.java 4 Jan 2006 14:29:50 -0000 1.46 *************** *** 441,446 **** v.setY(coord[1]); v.setZ(coord[2]); ! ! Project.getInstance().update(v); } else { log.error("[updateVertex] wrong argument length was: " + coord.length); --- 441,445 ---- v.setY(coord[1]); v.setZ(coord[2]); ! v.changed(); } else { log.error("[updateVertex] wrong argument length was: " + coord.length); *************** *** 483,487 **** */ protected void updateEdge(Edge e) { ! Project.getInstance().update(e); } --- 482,486 ---- */ protected void updateEdge(Edge e) { ! e.changed(); } Index: ShiftActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ShiftActionListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ShiftActionListener.java 11 Dec 2005 17:50:58 -0000 1.3 --- ShiftActionListener.java 4 Jan 2006 14:29:50 -0000 1.4 *************** *** 12,16 **** import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; - import net.sourceforge.bprocessor.model.Project; import org.apache.log4j.Logger; --- 12,15 ---- *************** *** 49,60 **** surface.setBackDomain(front); ! Project.getInstance().update(surface); if (back != null) { back.addSurface(surface); ! Project.getInstance().update(back); } if (front != null) { front.addSurface(surface); ! Project.getInstance().update(front); } } --- 48,59 ---- surface.setBackDomain(front); ! surface.changed(); if (back != null) { back.addSurface(surface); ! back.changed(); } if (front != null) { front.addSurface(surface); ! front.changed(); } } |
From: Michael L. <he...@us...> - 2006-01-04 12:57:54
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27661/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Default colors changed Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** View.java 3 Jan 2006 12:24:47 -0000 1.37 --- View.java 4 Jan 2006 12:57:43 -0000 1.38 *************** *** 80,89 **** /** Surface color for all not selected surfaces */ public static final float[] SURFACE_COLOR = new float[] {1.0f, 1.0f, 1.0f}; - - /** Front color for surfaces */ - public static final float[] FRONT_COLOR = new float[] {0.96f, 0.87f, 0.70f}; - - /** Back color for surfaces */ - public static final float[] BACK_COLOR = new float[] {0.94f, 0.97f, 1.00f}; /** Used for selected objects */ --- 80,83 ---- *************** *** 103,113 **** /** Front color for surfaces */ ! protected static float[] frontColor = new float[] {0.96f, 0.87f, 0.70f}; /** NONE color for surfaces */ ! protected static float[] noneColor = new float[] {0.70f, 0.70f, 0.70f}; /** Back color for surfaces */ ! protected static float[] backColor = new float[] {0.40f, 0.58f, 0.93f}; /** Select mode for selecting edges */ --- 97,107 ---- /** Front color for surfaces */ ! protected static float[] frontColor = new float[] {0.90f, 0.90f, 0.90f}; /** NONE color for surfaces */ ! protected static float[] noneColor = new float[] {0.40f, 0.58f, 0.93f}; /** Back color for surfaces */ ! protected static float[] backColor = new float[] {0.96f, 0.87f, 0.70f}; /** Select mode for selecting edges */ |
From: Michael L. <he...@us...> - 2006-01-03 16:00:33
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14803/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Removed Files: SurfacesTreeView.java SpacesTreeView.java Log Message: Removed old treeviews --- SurfacesTreeView.java DELETED --- --- SpacesTreeView.java DELETED --- Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GenericTreeView.java 3 Jan 2006 15:46:55 -0000 1.3 --- GenericTreeView.java 3 Jan 2006 16:00:24 -0000 1.4 *************** *** 344,348 **** */ public void update(Object object) { ! System.out.println("update " + object); } --- 344,348 ---- */ public void update(Object object) { ! changed(); } |
From: Michael L. <he...@us...> - 2006-01-03 15:47:03
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11228/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: GenericTreeView implements observer Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GenericTreeView.java 3 Jan 2006 12:14:04 -0000 1.2 --- GenericTreeView.java 3 Jan 2006 15:46:55 -0000 1.3 *************** *** 23,26 **** --- 23,28 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.Observer; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 30,34 **** * The GenericTreeView */ ! public class GenericTreeView extends TreeView implements NotificationListener { /** The model */ --- 32,36 ---- * The GenericTreeView */ ! public class GenericTreeView extends TreeView implements NotificationListener, Observer { /** The model */ *************** *** 52,55 **** --- 54,58 ---- setShowsRootHandles(true); Notifier.getInstance().addListener(this); + Project.getInstance().addObserver(this); this.addTreeSelectionListener(new SelectionListener()); model = (DefaultTreeModel) getModel(); *************** *** 336,338 **** --- 339,349 ---- } + /** + * Update + * @param object The changed object + */ + public void update(Object object) { + System.out.println("update " + object); + } + } |
From: Michael L. <he...@us...> - 2006-01-03 13:23:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8715/src/net/sourceforge/bprocessor/model Modified Files: Observer.java Project.java Log Message: Type changed from Entity to Object in observer mechanism Index: Observer.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Observer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Observer.java 3 Jan 2006 13:03:32 -0000 1.1 --- Observer.java 3 Jan 2006 13:23:22 -0000 1.2 *************** *** 19,22 **** * @param entity Changed entity */ ! public void update(Entity entity); } --- 19,22 ---- * @param entity Changed entity */ ! public void update(Object entity); } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Project.java 3 Jan 2006 13:03:32 -0000 1.13 --- Project.java 3 Jan 2006 13:23:22 -0000 1.14 *************** *** 74,78 **** * @param entity The changed entity */ ! public void changed(Entity entity) { Iterator iter = observers.iterator(); while (iter.hasNext()) { --- 74,78 ---- * @param entity The changed entity */ ! public void changed(Object entity) { Iterator iter = observers.iterator(); while (iter.hasNext()) { |
From: Michael L. <he...@us...> - 2006-01-03 13:03:40
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2428/src/net/sourceforge/bprocessor/model Modified Files: Project.java Entity.java Added Files: Observer.java Log Message: An observer mechanism has been implmented. Very simple change-propagation. --- NEW FILE: Observer.java --- //--------------------------------------------------------------------------------- // $Id: Observer.java,v 1.1 2006/01/03 13:03:32 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model; /** * The Observer interface is for observing changes to entities * in the project. When an entity is changed, the update message * is send to all observers with the entity supplied as * argument. */ public interface Observer { /** * Update * @param entity Changed entity */ public void update(Entity entity); } Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Entity.java 19 Dec 2005 19:37:54 -0000 1.1 --- Entity.java 3 Jan 2006 13:03:32 -0000 1.2 *************** *** 43,46 **** --- 43,53 ---- return "Entity"; } + + /** + * Tell observers that this entity has changed + */ + public void changed() { + Project.getInstance().changed(this); + } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Project.java 22 Dec 2005 10:35:01 -0000 1.12 --- Project.java 3 Jan 2006 13:03:32 -0000 1.13 *************** *** 10,13 **** --- 10,15 ---- import java.util.HashSet; import java.util.Iterator; + import java.util.LinkedList; + import java.util.List; import java.util.Set; *************** *** 30,33 **** --- 32,38 ---- private static Project instance; + /** The observers */ + private List observers; + /** * Get the instance *************** *** 40,43 **** --- 45,85 ---- return instance; } + + /** + * Constructor for Project + */ + public Project() { + super(); + observers = new LinkedList(); + } + + /** + * Add observer + * @param observer The observer + */ + public void addObserver(Observer observer) { + observers.add(observer); + } + + /** + * Remove observer + * @param observer The observer + */ + public void removeObserver(Observer observer) { + observers.remove(observer); + } + + /** + * Tell observers to update because an entity has changed + * @param entity The changed entity + */ + public void changed(Entity entity) { + Iterator iter = observers.iterator(); + while (iter.hasNext()) { + Observer current = (Observer) iter.next(); + current.update(entity); + } + } + /** * Clear all objects |
From: Michael L. <he...@us...> - 2006-01-03 12:24:56
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25626/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Surface now visible if both sides have construction-space Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** View.java 20 Dec 2005 22:01:36 -0000 1.36 --- View.java 3 Jan 2006 12:24:47 -0000 1.37 *************** *** 1346,1352 **** return false; } - if ((front.isConstructionSpace()) && (back.isConstructionSpace())) { - return false; - } return true; } --- 1346,1349 ---- |
From: Michael L. <he...@us...> - 2006-01-03 12:14:13
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22047/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: New simplified treeviews in use Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** GUI.java 3 Jan 2006 10:53:50 -0000 1.20 --- GUI.java 3 Jan 2006 12:14:04 -0000 1.21 *************** *** 23,29 **** import net.sourceforge.bprocessor.gui.splash.SplashWindow; import net.sourceforge.bprocessor.gui.treeview.GenericTreeView; ! import net.sourceforge.bprocessor.gui.treeview.SpacesTreeView; ! import net.sourceforge.bprocessor.gui.treeview.SurfacesTreeView; ! import java.awt.BorderLayout; import java.awt.Component; --- 23,28 ---- import net.sourceforge.bprocessor.gui.splash.SplashWindow; import net.sourceforge.bprocessor.gui.treeview.GenericTreeView; ! import net.sourceforge.bprocessor.gui.treeview.SpaceTreeView; ! import net.sourceforge.bprocessor.gui.treeview.SurfaceTreeView; import java.awt.BorderLayout; import java.awt.Component; *************** *** 307,312 **** tp.setFont(font); tp.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); ! tp.addTab("Spaces", new JScrollPane (new SpacesTreeView())); ! tp.addTab("Surfaces", new JScrollPane (new SurfacesTreeView())); tp.addTab("Views", new JScrollPane (new GenericTreeView())); --- 306,311 ---- tp.setFont(font); tp.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); ! tp.addTab("Spaces", new JScrollPane (new SpaceTreeView())); ! tp.addTab("Surfaces", new JScrollPane (new SurfaceTreeView())); tp.addTab("Views", new JScrollPane (new GenericTreeView())); |
From: Michael L. <he...@us...> - 2006-01-03 12:14:13
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22047/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java SurfaceTreeView.java Log Message: New simplified treeviews in use Index: SurfaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SurfaceTreeView.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceTreeView.java 3 Jan 2006 10:53:50 -0000 1.1 --- SurfaceTreeView.java 3 Jan 2006 12:14:04 -0000 1.2 *************** *** 10,13 **** --- 10,14 ---- import java.util.Set; + import net.sourceforge.bprocessor.kernel.notification.Notification; import net.sourceforge.bprocessor.model.Project; *************** *** 29,33 **** */ public void update() { - System.out.println("update " + System.currentTimeMillis()); root.removeAllChildren(); Set surfaces = Project.getInstance().getSurfaces(); --- 30,33 ---- *************** *** 36,40 **** } ! } --- 36,52 ---- } ! /** ! * Specify if we want to handle notification ! * @param type String specifying type of notification ! * @return True if we want to handle it ! */ ! public boolean isNotificationEnabled(String type) { ! if (type.equals(Notification.SURFACE_CREATED) || ! type.equals(Notification.SURFACE_DELETED) || ! type.equals(Notification.SURFACE_MODIFIED)) { ! return true; ! } ! return false; ! } } Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GenericTreeView.java 3 Jan 2006 10:53:50 -0000 1.1 --- GenericTreeView.java 3 Jan 2006 12:14:04 -0000 1.2 *************** *** 197,201 **** super(space); Set surfaces = space.getSurfaces(); ! add(new SurfaceContainer("Surfaces", surfaces)); } } --- 197,202 ---- super(space); Set surfaces = space.getSurfaces(); ! add(new SurfaceContainer("Surface", surfaces)); ! add(new ContainerNode("Element")); } } *************** *** 211,215 **** public SurfaceNode(Surface surface) { super(surface); ! add(new EdgeContainer("Edges", surface.getEdges())); } } --- 212,216 ---- public SurfaceNode(Surface surface) { super(surface); ! add(new EdgeContainer("Edge", surface.getEdges())); } } *************** *** 332,343 **** */ public boolean isNotificationEnabled(String type) { - if (type.equals(Notification.FUNCTIONAL_SPACE_CREATED) || - type.equals(Notification.FUNCTIONAL_SPACE_DELETED) || - type.equals(Notification.FUNCTIONAL_SPACE_MODIFIED) || - type.equals(Notification.CONSTRUCTION_SPACE_CREATED) || - type.equals(Notification.CONSTRUCTION_SPACE_DELETED) || - type.equals(Notification.CONSTRUCTION_SPACE_MODIFIED)) { - return true; - } return false; } --- 333,336 ---- Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SpaceTreeView.java 3 Jan 2006 10:53:50 -0000 1.1 --- SpaceTreeView.java 3 Jan 2006 12:14:04 -0000 1.2 *************** *** 10,13 **** --- 10,14 ---- import java.util.Set; + import net.sourceforge.bprocessor.kernel.notification.Notification; import net.sourceforge.bprocessor.model.Project; *************** *** 28,32 **** */ public void update() { - System.out.println("update " + System.currentTimeMillis()); root.removeAllChildren(); Set construction = Project.getInstance().getConstructionSpaces(); --- 29,32 ---- *************** *** 37,39 **** --- 37,57 ---- model.nodeStructureChanged(root); } + + /** + * Specify if we want to handle notification + * @param type String specifying type of notification + * @return True if we want to handle it + */ + public boolean isNotificationEnabled(String type) { + if (type.equals(Notification.FUNCTIONAL_SPACE_CREATED) || + type.equals(Notification.FUNCTIONAL_SPACE_DELETED) || + type.equals(Notification.FUNCTIONAL_SPACE_MODIFIED) || + type.equals(Notification.CONSTRUCTION_SPACE_CREATED) || + type.equals(Notification.CONSTRUCTION_SPACE_DELETED) || + type.equals(Notification.CONSTRUCTION_SPACE_MODIFIED)) { + return true; + } + return false; + } + } |
From: Michael L. <he...@us...> - 2006-01-03 10:53:59
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4168/src/net/sourceforge/bprocessor/gui/treeview Modified Files: TreeView.java Added Files: GenericTreeView.java SpaceTreeView.java SurfaceTreeView.java Log Message: Added some simple treeview classes --- NEW FILE: SurfaceTreeView.java --- //--------------------------------------------------------------------------------- // $Id: SurfaceTreeView.java,v 1.1 2006/01/03 10:53:50 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.treeview; import java.util.Set; import net.sourceforge.bprocessor.model.Project; /** * SurfaceTreeView */ public class SurfaceTreeView extends GenericTreeView { /** * Constructor for SurfaceTreeView */ public SurfaceTreeView() { super(); } /** * Update the TreeView * */ public void update() { System.out.println("update " + System.currentTimeMillis()); root.removeAllChildren(); Set surfaces = Project.getInstance().getSurfaces(); root.add(new SurfaceContainer("Surfaces", surfaces)); model.nodeStructureChanged(root); } } Index: TreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/TreeView.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TreeView.java 27 Jun 2005 09:32:23 -0000 1.1.1.1 --- TreeView.java 3 Jan 2006 10:53:50 -0000 1.2 *************** *** 7,10 **** --- 7,12 ---- package net.sourceforge.bprocessor.gui.treeview; + import java.awt.Font; + import javax.swing.JTree; import javax.swing.tree.TreeSelectionModel; *************** *** 26,29 **** --- 28,33 ---- getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); setEditable(false); + Font font = new Font("Sans-serif", Font.PLAIN, 12); + this.setFont(font); } --- NEW FILE: GenericTreeView.java --- //--------------------------------------------------------------------------------- // $Id: GenericTreeView.java,v 1.1 2006/01/03 10:53:50 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.treeview; import java.util.Iterator; import java.util.List; import java.util.Set; import javax.swing.SwingUtilities; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; import net.sourceforge.bprocessor.kernel.notification.Notification; import net.sourceforge.bprocessor.kernel.notification.NotificationListener; import net.sourceforge.bprocessor.kernel.notification.Notifier; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** * The GenericTreeView */ public class GenericTreeView extends TreeView implements NotificationListener { /** The model */ protected DefaultTreeModel model; /** The root */ protected DefaultMutableTreeNode root; /** Flag saying that we are changed */ private boolean isChanged; /** Current selection */ private Object selection; /** * Constructor for GenericTreeView */ public GenericTreeView() { super(); setRootVisible(false); setShowsRootHandles(true); Notifier.getInstance().addListener(this); this.addTreeSelectionListener(new SelectionListener()); model = (DefaultTreeModel) getModel(); root = (DefaultMutableTreeNode) model.getRoot(); root.removeAllChildren(); model.nodeStructureChanged(root); isChanged = false; changed(); } /** * Tell the TreeView we are changed * */ public void changed() { if (!isChanged) { isChanged = true; SwingUtilities.invokeLater ( new Runnable() { public void run() { flush(); } } ); } } /** * Update the TreeView * */ public void update() { } /** * Flush update * */ public void flush() { if (isChanged) { update(); isChanged = false; } } /** * Set selection to target * @param target Object */ public void select(Object target) { if (selection != null) { if (selection instanceof Space) { Space space = (Space) selection; if (space.isFunctionalSpace()) { Notification n = new Notification(Notification.FUNCTIONAL_SPACE_DESELECTED, space.getId()); Notifier.getInstance().sendNotification(n); } else { Notification n = new Notification(Notification.CONSTRUCTION_SPACE_DESELECTED, space.getId()); Notifier.getInstance().sendNotification(n); } } else if (selection instanceof Surface) { Surface surface = (Surface) selection; Notification n = new Notification(Notification.SURFACE_DESELECTED, surface.getId()); Notifier.getInstance().sendNotification(n); } } selection = target; if (selection != null) { if (selection instanceof Space) { Space space = (Space) selection; if (space.isFunctionalSpace()) { Notification n = new Notification(Notification.FUNCTIONAL_SPACE_SELECTED, space.getId()); Notifier.getInstance().sendNotification(n); } else { Notification n = new Notification(Notification.CONSTRUCTION_SPACE_SELECTED, space.getId()); Notifier.getInstance().sendNotification(n); } } else if (selection instanceof Surface) { Surface surface = (Surface) selection; Notification n = new Notification(Notification.SURFACE_SELECTED, surface.getId()); Notifier.getInstance().sendNotification(n); } } } /** * ContainerNode */ public class ContainerNode extends DefaultMutableTreeNode { /** * Constructor for ContainerNode * @param object User object */ public ContainerNode(Object object) { super(object); } /** * Always not be leaf * @return answer */ public boolean isLeaf() { return false; } } /** * The EntityNode */ public class EntityNode extends DefaultMutableTreeNode { /** * Constructor for EntityNode * @param object User object */ public EntityNode(Object object) { super(object); } /** * Return the displaystring for this EntityNode * @return Display string */ public String toString() { Object object = this.getUserObject(); if (object instanceof Entity) { Entity entity = (Entity) object; return entity.getName(); } else { return object.toString(); } } } /** * SpaceNode */ public class SpaceNode extends EntityNode { /** * Constructor for SpaceNode * @param space Space */ public SpaceNode(Space space) { super(space); Set surfaces = space.getSurfaces(); add(new SurfaceContainer("Surfaces", surfaces)); } } /** * SurfaceNode */ public class SurfaceNode extends EntityNode { /** * Constructor for SurfaceNode * @param surface The surface */ public SurfaceNode(Surface surface) { super(surface); add(new EdgeContainer("Edges", surface.getEdges())); } } /** * EdgeNode */ public class EdgeNode extends EntityNode { /** * Constructor for SurfaceNode * @param edge The edge */ public EdgeNode(Edge edge) { super(edge); add(new VertexNode(edge.getFrom())); add(new VertexNode(edge.getTo())); } } /** * VertexNode */ public class VertexNode extends EntityNode { /** * Constructor for VertexNode * @param vertex The vertex */ public VertexNode(Vertex vertex) { super(vertex); } } /** * SpaceContainer */ public class SpaceContainer extends ContainerNode { /** * Constructor for SpaceContainer * @param name Display name * @param spaces The spaces */ public SpaceContainer(String name, Set spaces) { super(name); Iterator iter = spaces.iterator(); while (iter.hasNext()) { Space current = (Space) iter.next(); add(new SpaceNode(current)); } } } /** * SurfaceContainer */ public class SurfaceContainer extends ContainerNode { /** * Constructor for SurfaceContainer * @param name The name * @param surfaces The surfaces */ public SurfaceContainer(String name, Set surfaces) { super(name); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); add(new SurfaceNode(current)); } } } /** * EdgeContainer */ public class EdgeContainer extends ContainerNode { /** * Constructor for EdgeContainer * @param name The name * @param edges The edges */ public EdgeContainer(String name, List edges) { super(name); Iterator iter = edges.iterator(); while (iter.hasNext()) { Edge current = (Edge) iter.next(); add(new EdgeNode(current)); } } } /** * Selection Listener */ private class SelectionListener implements TreeSelectionListener { /** * ValueChanged * @param event The Event */ public void valueChanged(TreeSelectionEvent event) { TreePath path = event.getPath(); Object object = path.getLastPathComponent(); if (object instanceof DefaultMutableTreeNode) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) object; Object target = node.getUserObject(); select(target); } } } /** * Handle notification * @param arg0 The notification */ public void handleNotification(Notification arg0) { changed(); } /** * Specify if we want to handle notification * @param type String specifying type of notification * @return True if we want to handle it */ public boolean isNotificationEnabled(String type) { if (type.equals(Notification.FUNCTIONAL_SPACE_CREATED) || type.equals(Notification.FUNCTIONAL_SPACE_DELETED) || type.equals(Notification.FUNCTIONAL_SPACE_MODIFIED) || type.equals(Notification.CONSTRUCTION_SPACE_CREATED) || type.equals(Notification.CONSTRUCTION_SPACE_DELETED) || type.equals(Notification.CONSTRUCTION_SPACE_MODIFIED)) { return true; } return false; } } --- NEW FILE: SpaceTreeView.java --- //--------------------------------------------------------------------------------- // $Id: SpaceTreeView.java,v 1.1 2006/01/03 10:53:50 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.treeview; import java.util.Set; import net.sourceforge.bprocessor.model.Project; /** * The SpaceTreeView */ public class SpaceTreeView extends GenericTreeView { /** * Constructor for SpaceTreeView */ public SpaceTreeView() { super(); } /** * Update the treeview */ public void update() { System.out.println("update " + System.currentTimeMillis()); root.removeAllChildren(); Set construction = Project.getInstance().getConstructionSpaces(); Set functional = Project.getInstance().getFunctionalSpaces(); Set surfaces = Project.getInstance().getSurfaces(); root.add(new SpaceContainer("Functional", functional)); root.add(new SpaceContainer("Construction", construction)); model.nodeStructureChanged(root); } } |
From: Michael L. <he...@us...> - 2006-01-03 10:53:59
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4168/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Added some simple treeview classes Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** GUI.java 23 Dec 2005 11:19:03 -0000 1.19 --- GUI.java 3 Jan 2006 10:53:50 -0000 1.20 *************** *** 22,25 **** --- 22,26 ---- import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.gui.splash.SplashWindow; + import net.sourceforge.bprocessor.gui.treeview.GenericTreeView; import net.sourceforge.bprocessor.gui.treeview.SpacesTreeView; import net.sourceforge.bprocessor.gui.treeview.SurfacesTreeView; *************** *** 27,30 **** --- 28,32 ---- import java.awt.BorderLayout; import java.awt.Component; + import java.awt.Font; import java.awt.event.KeyEvent; *************** *** 301,309 **** getContentPane().add(splitPaneLeftRight, BorderLayout.CENTER); JTabbedPane tp = new JTabbedPane(JTabbedPane.TOP); tp.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); tp.addTab("Spaces", new JScrollPane (new SpacesTreeView())); tp.addTab("Surfaces", new JScrollPane (new SurfacesTreeView())); ! tp.addTab("Views", new JScrollPane (null)); registerPanel(tp, SPLIT_LEFT); --- 303,313 ---- getContentPane().add(splitPaneLeftRight, BorderLayout.CENTER); + Font font = new Font("Sans-serif", Font.BOLD, 12); JTabbedPane tp = new JTabbedPane(JTabbedPane.TOP); + tp.setFont(font); tp.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); tp.addTab("Spaces", new JScrollPane (new SpacesTreeView())); tp.addTab("Surfaces", new JScrollPane (new SurfacesTreeView())); ! tp.addTab("Views", new JScrollPane (new GenericTreeView())); registerPanel(tp, SPLIT_LEFT); |
From: Michael L. <he...@us...> - 2006-01-03 10:53:07
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3981/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Fixed bug with interior surfaces Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Space.java 19 Dec 2005 19:37:54 -0000 1.10 --- Space.java 3 Jan 2006 10:52:57 -0000 1.11 *************** *** 113,117 **** */ public Set getSurfaces() { ! return surfaces; } --- 113,121 ---- */ public Set getSurfaces() { ! if (surfaces != null) { ! return surfaces; ! } else { ! return new HashSet(); ! } } *************** *** 129,140 **** */ public void addSurface(Surface surface) { ! Set s = getSurfaces(); ! if (s == null) { ! Set set = new HashSet(); ! set.add(surface); ! setSurfaces(set); ! } else { ! s.add(surface); } Project.getInstance().update(this); } --- 133,140 ---- */ public void addSurface(Surface surface) { ! if (surfaces == null) { ! surfaces = new HashSet(); } + surfaces.add(surface); Project.getInstance().update(this); } *************** *** 160,165 **** */ public String toString() { ! return "Domain[id=" + id + ",name=" + name + ",attributes=" + attributes.size() + ! ",surfaces=" + surfaces == null ? "0" : surfaces.size() + "]"; } --- 160,164 ---- */ public String toString() { ! return getName(); } |
From: Nordholt <nor...@us...> - 2005-12-29 15:06:59
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17768 Modified Files: AbstractTool.java SelectTool.java Log Message: You can now delete edges even if they are part of surfaces. If you do the surfaces will be deleted aswell. Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** SelectTool.java 12 Dec 2005 10:05:52 -0000 1.47 --- SelectTool.java 29 Dec 2005 15:06:48 -0000 1.48 *************** *** 372,379 **** } else if (selected instanceof Edge) { Edge selectedEdge = (Edge)selected; ! if (selectedEdge.getSurfaces().size() < 1) { ! selection.remove(selectedEdge); ! deleteEdge(selectedEdge); ! } } else if (selected instanceof Vertex) { selection.remove(selected); --- 372,377 ---- } else if (selected instanceof Edge) { Edge selectedEdge = (Edge)selected; ! selection.remove(selectedEdge); ! deleteEdge(selectedEdge); } else if (selected instanceof Vertex) { selection.remove(selected); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** AbstractTool.java 29 Dec 2005 14:21:58 -0000 1.44 --- AbstractTool.java 29 Dec 2005 15:06:48 -0000 1.45 *************** *** 519,523 **** while (it.hasNext()) { Edge edge = (Edge)it.next(); ! deleteEdge(edge); } glv.repaint(); --- 519,525 ---- while (it.hasNext()) { Edge edge = (Edge)it.next(); ! if (edge.getSurfaces().size() < 1) { ! deleteEdge(edge); ! } } glv.repaint(); *************** *** 531,546 **** if (edge.getId() != null) { Set surfaces = edge.getSurfaces(); ! if (surfaces.size() < 1) { ! removeEdge(edge); ! glv.repaint(); ! deleteVertex(edge.getTo()); ! deleteVertex(edge.getFrom()); } - } else { deleteVertex(edge.getTo()); deleteVertex(edge.getFrom()); } } ! /** * Deletes a vertex if it is safe to do so. --- 533,548 ---- if (edge.getId() != null) { Set surfaces = edge.getSurfaces(); ! removeEdge(edge); ! Iterator it = surfaces.iterator(); ! while (it.hasNext()) { ! Surface surf = (Surface)it.next(); ! deleteSurface(surf); } deleteVertex(edge.getTo()); deleteVertex(edge.getFrom()); + glv.repaint(); } } ! /** * Deletes a vertex if it is safe to do so. |
From: Nordholt <nor...@us...> - 2005-12-29 14:22:09
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10438 Modified Files: AbstractTool.java Log Message: fixed the way arrowkeys moves the camera. Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** AbstractTool.java 21 Dec 2005 14:37:17 -0000 1.43 --- AbstractTool.java 29 Dec 2005 14:21:58 -0000 1.44 *************** *** 170,173 **** --- 170,182 ---- public void keyPressed(KeyEvent e) { Camera c = glv.getView().getCamera(); + Vertex up = new Vertex(c.getRoll()[0], c.getRoll()[1], c.getRoll()[2]); + double x = c.getCenter()[0] - c.getCamera()[0]; + double y = c.getCenter()[1] - c.getCamera()[1]; + double z = c.getCenter()[2] - c.getCamera()[2]; + Vertex forward = new Vertex(x, y, z); + forward.scale(2 / forward.length()); + Vertex sidewards = up.cross(forward); + sidewards.scale(2 / sidewards.length()); + up.scale(2 / up.length()); if ((e.getModifiersEx() & KeyEvent.SHIFT_DOWN_MASK) == KeyEvent.SHIFT_DOWN_MASK) { // IF SHIFT IS PRESSED AS MODIFIER *************** *** 179,189 **** } else { if (e.getKeyCode() == KeyEvent.VK_UP) { ! c.translate(new double[] {0.0, -1.0, 0.0}); } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { ! c.translate(new double[] {0.0, 1.0, 0.0}); } else if (e.getKeyCode() == KeyEvent.VK_LEFT) { ! c.translate(new double[] {-1.0, 0.0, 0.0}); } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) { ! c.translate(new double[] {1.0, 0.0, 0.0}); } else if (e.getKeyCode() == KeyEvent.VK_Z) { c.zoomout(); --- 188,198 ---- } else { if (e.getKeyCode() == KeyEvent.VK_UP) { ! c.translate(new double[] {up.getX(), up.getY(), up.getZ()}); } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { ! c.translate(new double[] {-up.getX(), -up.getY(), -up.getZ()}); } else if (e.getKeyCode() == KeyEvent.VK_LEFT) { ! c.translate(new double[] {sidewards.getX(), sidewards.getY(), sidewards.getZ()}); } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) { ! c.translate(new double[] {-sidewards.getX(), -sidewards.getY(), -sidewards.getZ()}); } else if (e.getKeyCode() == KeyEvent.VK_Z) { c.zoomout(); |
From: Nordholt <nor...@us...> - 2005-12-29 14:20:49
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10224 Modified Files: PencilTool.java Log Message: snap-constructors are now better aligned when there is a current plane. You are not allowed to draw outside the currentplane if you have allready drawn to edges or more. Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** PencilTool.java 26 Dec 2005 15:10:28 -0000 1.53 --- PencilTool.java 29 Dec 2005 14:20:41 -0000 1.54 *************** *** 203,207 **** if (showConstructors) { clearConstructors(snapConstructors); ! snapConstructors = makeXYZConstructors(vertex); } } --- 203,213 ---- if (showConstructors) { clearConstructors(snapConstructors); ! if (currentPlane != null && edges != null && edges.size() > 0) { ! int size = edges.size(); ! Edge lastEdge = (Edge)edges.get(size - 1); ! snapConstructors = makeInPlaneConstructors(vertex, lastEdge, currentPlane); ! } else { ! snapConstructors = makeXYZConstructors(vertex); ! } } } *************** *** 488,491 **** --- 494,498 ---- setSnapVertex(null); exterior = null; + currentPlane = null; } } *************** *** 716,719 **** --- 723,744 ---- } } + + /* + * Should disallow you to draw out of the current plane if + * you allready have two or more edges. Thus disallowing you + * to draw non-plane surfaces. + */ + if (legal && + currentPlane != null && + edges != null && + edges.size() > 1) { + double[] planeRep = currentPlane.getDoublev(); + if (Math.abs(current.getX() * planeRep[0] + + current.getY() * planeRep[1] + + current.getZ() * planeRep[2] + + planeRep[3]) > 0.00001) { + legal = false; + } + } return legal; } |
From: Nordholt <nor...@us...> - 2005-12-29 14:16:39
|
Update of /cvsroot/bprocessor/build/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9563 Modified Files: README Log Message: added describtion for SPACE key in the penciltool Index: README =================================================================== RCS file: /cvsroot/bprocessor/build/doc/README,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** README 15 Dec 2005 13:02:51 -0000 1.9 --- README 29 Dec 2005 14:16:30 -0000 1.10 *************** *** 56,61 **** 0...9 : Change the wanted length on the active edge (direction have to be chosen with the mouse) BACKSPACE : Delete a digit in the specified length ! Enter : Make the active edge the specified length and continue the drawing. It is possible to split lines and spaces. <-- SELECTION --> --- 56,62 ---- 0...9 : Change the wanted length on the active edge (direction have to be chosen with the mouse) BACKSPACE : Delete a digit in the specified length ! ENTER : Make the active edge the specified length and continue the drawing. It is possible to split lines and spaces. + SPACE: enables/disables temporary constuction lines. <-- SELECTION --> |
From: Nordholt <nor...@us...> - 2005-12-26 15:13:10
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10596 Modified Files: Plane.java Log Message: corrected documentation Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Plane.java 19 Dec 2005 07:50:06 -0000 1.11 --- Plane.java 26 Dec 2005 15:13:02 -0000 1.12 *************** *** 12,16 **** * The Plane * A Plane is defined by the equation ! * Ax + By + Cy + D = 0 */ public class Plane { --- 12,16 ---- * The Plane * A Plane is defined by the equation ! * Ax + By + Cz + D = 0 */ public class Plane { *************** *** 144,148 **** return intersection(p0, p1); } ! /** * To string --- 144,148 ---- return intersection(p0, p1); } ! /** * To string |
From: Nordholt <nor...@us...> - 2005-12-26 15:10:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10121 Modified Files: PencilTool.java Log Message: added method for finding the plane currently being drawn in, if such a plane can be found there is now only two constructors both in that plane Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** PencilTool.java 21 Dec 2005 14:37:17 -0000 1.52 --- PencilTool.java 26 Dec 2005 15:10:28 -0000 1.53 *************** *** 51,54 **** --- 51,60 ---- /** The constructors from the snap vertex */ private Set snapConstructors; + + /** Whether to show the constructors */ + private boolean showConstructors; + + /** The plane currently drawn in */ + private Plane currentPlane; /** The active */ *************** *** 101,104 **** --- 107,111 ---- public PencilTool(GLView glv, Cursor cursor) { super(glv, cursor); + showConstructors = true; } *************** *** 194,204 **** snapVertex = vertex; glv.getView().setSnapVertex(vertex); ! clearConstructors(snapConstructors); ! snapConstructors = makeXYZConstructors(vertex); } } ! } ! ! --- 201,211 ---- snapVertex = vertex; glv.getView().setSnapVertex(vertex); ! if (showConstructors) { ! clearConstructors(snapConstructors); ! snapConstructors = makeXYZConstructors(vertex); ! } } } ! } *************** *** 234,240 **** constructors.add(y); constructors.add(z); ! glv.getView().addTempEdge(x); ! glv.getView().addTempEdge(y); ! glv.getView().addTempEdge(z); return constructors; } --- 241,247 ---- constructors.add(y); constructors.add(z); ! if (showConstructors) { ! displayConstructors(constructors); ! } return constructors; } *************** *** 305,316 **** constructors.add(second); constructors.add(third); ! glv.getView().addTempEdge(first); ! glv.getView().addTempEdge(second); ! glv.getView().addTempEdge(third); return constructors; } return null; } ! /** * Removes a set of constructors. --- 312,373 ---- constructors.add(second); constructors.add(third); ! if (showConstructors) { ! displayConstructors(constructors); ! } return constructors; } return null; } ! ! ! /** ! * makes a constructor on an edge and an other constructor ! * that is othogonal to the first and lies in a given plane. ! * The constructors are returned in a set. ! * If no such constructors can be created null is returned. ! * @param v the vertex where the to constructors should cross. ! * @param e the edge ! * @param p the plane ! * @return the set of constructors. ! */ ! public Set makeInPlaneConstructors(Vertex v, Edge e, Plane p) { ! if (v != null && e != null && p != null) { ! /** ! algorithm: the A, B, C part of the plane equation is ! a normal-vector for the plane. By first finding a ! vector with the direction of the edge and finding a ! cross with the normal vector we should find a vector in the plane ! orthogonal to the edge. ! */ ! double[] planeRep = p.getDoublev(); ! Vertex planeNormal = new Vertex(planeRep[0], planeRep[1], planeRep[2]); ! Vertex edgeDir = e.getTo().minus(e.getFrom()); ! Vertex orthoDir = edgeDir.cross(planeNormal); ! ! edgeDir.scale(50 / edgeDir.length()); ! Vertex fromEdge = edgeDir.copy().add(v); ! edgeDir.scale(-1); ! Vertex toEdge = edgeDir.copy().add(v); ! Edge edgeConstructor = new Edge(fromEdge, toEdge); ! edgeConstructor.setConstructor(true); ! ! orthoDir.scale(50 / orthoDir.length()); ! Vertex fromOrtho = orthoDir.copy().add(v); ! orthoDir.scale(-1); ! Vertex toOrtho = orthoDir.copy().add(v); ! Edge orthoConstructor = new Edge(fromOrtho, toOrtho); ! orthoConstructor.setConstructor(true); ! ! Set constructors = new HashSet(); ! constructors.add(orthoConstructor); ! constructors.add(edgeConstructor); ! if (showConstructors) { ! displayConstructors(constructors); ! } ! return constructors; ! } ! return null; ! } ! /** * Removes a set of constructors. *************** *** 326,329 **** --- 383,400 ---- } } + + /** + * Makes a set of constructors be displayed. + * @param constructors a set of constructors. + */ + private void displayConstructors(Set constructors) { + if (constructors != null) { + Iterator it = constructors.iterator(); + while (it.hasNext()) { + Edge constructor = (Edge)it.next(); + glv.getView().addTempEdge(constructor); + } + } + } /** *************** *** 364,367 **** --- 435,440 ---- if (active == null) { edges = new ArrayList(); + currentPlane = null; + findCurrentPlane(); intern(vertex); from = vertex; *************** *** 376,381 **** clearConstructors(currentConstructors); ! currentConstructors = makeAlignedConstructors(vertex, active); ! from = vertex; active = new Edge(from, to); --- 449,461 ---- clearConstructors(currentConstructors); ! findCurrentPlane(); ! if (currentPlane == null) { ! currentConstructors = makeAlignedConstructors(vertex, active); ! } else { ! currentConstructors = makeInPlaneConstructors(vertex, ! active, ! currentPlane); ! } ! from = vertex; active = new Edge(from, to); *************** *** 411,415 **** } } ! /** * Round to grid --- 491,528 ---- } } ! ! /** ! * Finds and sets the current plane if one can be found. ! */ ! private void findCurrentPlane() { ! if (edges != null && edges.size() > 1) { ! Iterator it = edges.iterator(); ! Edge edge1 = null; ! Edge edge2 = null; ! edge1 = (Edge)it.next(); ! edge2 = (Edge)it.next();; ! currentPlane = planeFromEdges(edge1, edge2); ! } else if (target instanceof Surface) { ! Surface currentSurface = (Surface)target; ! currentPlane = currentSurface.plane(); ! } ! } ! ! /** ! * Calculates the plane of two edges ! * @param e1 the first edge ! * @param e2 the second edge ! * @return the plane ! */ ! private Plane planeFromEdges(Edge e1, Edge e2) { ! Vertex dir1 = e1.getTo().minus(e1.getFrom()); ! Vertex dir2 = e2.getTo().minus(e2.getFrom()); ! Vertex normal = dir1.cross(dir2); ! return new Plane(normal.getX(), normal.getY(), normal.getZ(), ! (-normal.getX() * e1.getTo().getX() - ! normal.getY() * e1.getTo().getY() - ! normal.getZ() * e1.getTo().getZ())); ! } ! /** * Round to grid *************** *** 784,787 **** --- 897,910 ---- } changed = true; + } else if (e.getKeyCode() == KeyEvent.VK_SPACE) { + showConstructors = !showConstructors; + if (!showConstructors) { + clearConstructors(currentConstructors); + clearConstructors(snapConstructors); + glv.repaint(); + } else { + displayConstructors(currentConstructors); + glv.repaint(); + } } else { super.keyPressed(e); |
From: Nordholt <nor...@us...> - 2005-12-26 15:09:17
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9936 Modified Files: TapeMeasureTool.java Log Message: fixed problem with axis aligned edges Index: TapeMeasureTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasureTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TapeMeasureTool.java 19 Dec 2005 07:51:30 -0000 1.5 --- TapeMeasureTool.java 26 Dec 2005 15:09:04 -0000 1.6 *************** *** 123,126 **** --- 123,127 ---- private void move(MouseEvent e) { edgeNormal.scale(1 / edgeNormal.length()); + Vertex moveVertex = edgeNormal.copy(); double x = e.getX(); double y = View.getHeight() - e.getY(); *************** *** 133,139 **** Vertex intersect = movePlane.intersection(ray); Vertex delta = intersect.minus(constructionPoint); ! edgeNormal.scale(edgeNormal.dot(delta) / (edgeNormal.length() * edgeNormal.length())); ! currentConstruction.move(edgeNormal.getX(), edgeNormal.getY(), edgeNormal.getZ()); ! constructionPoint.move(edgeNormal.getX(), edgeNormal.getY(), edgeNormal.getZ()); number = ""; glv.setLength(edgeToConstruction.getLength()); --- 134,141 ---- Vertex intersect = movePlane.intersection(ray); Vertex delta = intersect.minus(constructionPoint); ! moveVertex.scale(moveVertex.dot(delta) / (moveVertex.length() * ! moveVertex.length())); ! currentConstruction.move(moveVertex.getX(), moveVertex.getY(), moveVertex.getZ()); ! constructionPoint.move(moveVertex.getX(), moveVertex.getY(), moveVertex.getZ()); number = ""; glv.setLength(edgeToConstruction.getLength()); *************** *** 200,204 **** v.removeTempEdge(yAxis); v.removeTempEdge(zAxis); - } --- 202,205 ---- |
From: Michael L. <he...@us...> - 2005-12-23 11:19:31
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13161/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: Changed layout of main window Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** GLView.java 20 Dec 2005 12:24:10 -0000 1.30 --- GLView.java 23 Dec 2005 11:19:20 -0000 1.31 *************** *** 77,80 **** --- 77,82 ---- jp.add((Component) glc, BorderLayout.CENTER); jp.setMinimumSize(new Dimension(320, 240)); + jp.setPreferredSize(new Dimension(640, 480)); + JPanel lengthPanel = new JPanel(); lengthPanel.setLayout(new BorderLayout()); |
From: Michael L. <he...@us...> - 2005-12-23 11:19:17
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13055/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Log Message: Changed layout of main window Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** AttributeView.java 12 Dec 2005 10:06:21 -0000 1.11 --- AttributeView.java 23 Dec 2005 11:19:03 -0000 1.12 *************** *** 49,53 **** addTab("Attributes", ap); ! setMinimumSize(new Dimension(170, 120)); Notifier.getInstance().addListener(this); } --- 49,54 ---- addTab("Attributes", ap); ! setMinimumSize(new Dimension(120, 240)); ! setPreferredSize(new Dimension(120, 240)); Notifier.getInstance().addListener(this); } |
From: Michael L. <he...@us...> - 2005-12-23 11:19:17
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13055/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Changed layout of main window Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** GUI.java 20 Dec 2005 15:43:31 -0000 1.18 --- GUI.java 23 Dec 2005 11:19:03 -0000 1.19 *************** *** 27,31 **** import java.awt.BorderLayout; import java.awt.Component; - import java.awt.Dimension; import java.awt.event.KeyEvent; --- 27,30 ---- *************** *** 33,37 **** import javax.swing.JMenu; import javax.swing.JMenuItem; - import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; --- 32,35 ---- *************** *** 57,61 **** /** The middle/right split pane */ ! private JSplitPane splitPaneTopDown; /** The splash */ --- 55,59 ---- /** The middle/right split pane */ ! private JSplitPane splitPaneMiddleRight; /** The splash */ *************** *** 293,303 **** */ public void createMainView() { ! splitPaneTopDown = new JSplitPane(JSplitPane.VERTICAL_SPLIT); ! splitPaneTopDown.setTopComponent(new JPanel()); ! splitPaneTopDown.setBottomComponent(new JPanel()); splitPaneLeftRight = new JSplitPane(); ! splitPaneLeftRight.setRightComponent(new JPanel()); ! splitPaneLeftRight.setLeftComponent(splitPaneTopDown); getContentPane().setLayout(new BorderLayout()); --- 291,299 ---- */ public void createMainView() { ! splitPaneMiddleRight = new JSplitPane(); ! splitPaneMiddleRight.setResizeWeight(1.0); splitPaneLeftRight = new JSplitPane(); ! splitPaneLeftRight.setRightComponent(splitPaneMiddleRight); getContentPane().setLayout(new BorderLayout()); *************** *** 310,315 **** tp.addTab("Surfaces", new JScrollPane (new SurfacesTreeView())); tp.addTab("Views", new JScrollPane (null)); - tp.setPreferredSize(new Dimension(170, 340)); - splitPaneTopDown.setMinimumSize(new Dimension(170, 340)); registerPanel(tp, SPLIT_LEFT); --- 306,309 ---- *************** *** 326,334 **** public void registerPanel(Component panel, Integer placement) { if (placement.equals(SPLIT_LEFT)) { ! splitPaneTopDown.setTopComponent(new JScrollPane(panel)); } else if (placement.equals(SPLIT_MIDDLE)) { ! splitPaneLeftRight.setRightComponent(panel); } else { ! splitPaneTopDown.setBottomComponent(new JScrollPane(panel)); } } --- 320,328 ---- public void registerPanel(Component panel, Integer placement) { if (placement.equals(SPLIT_LEFT)) { ! splitPaneLeftRight.setLeftComponent(panel); } else if (placement.equals(SPLIT_MIDDLE)) { ! splitPaneMiddleRight.setLeftComponent(panel); } else { ! splitPaneMiddleRight.setRightComponent(panel); } } *************** *** 351,354 **** --- 345,349 ---- plash = null; } + pack(); setVisible(true); } |
From: Michael L. <he...@us...> - 2005-12-22 11:34:59
|
Update of /cvsroot/bprocessor/build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16854 Modified Files: build.xml Log Message: Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/build/build.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** build.xml 20 Dec 2005 18:23:06 -0000 1.10 --- build.xml 22 Dec 2005 11:34:51 -0000 1.11 *************** *** 3,7 **** <target name="init"> <property name="project" value="bprocessor"/> ! <property name="version" value="M3"/> <property name="script.dir" value="${basedir}/bin"/> --- 3,7 ---- <target name="init"> <property name="project" value="bprocessor"/> ! <property name="version" value="M3a"/> <property name="script.dir" value="${basedir}/bin"/> |
From: Michael L. <he...@us...> - 2005-12-22 11:34:39
|
Update of /cvsroot/bprocessor/build/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16801/doc Modified Files: Changelog Log Message: Index: Changelog =================================================================== RCS file: /cvsroot/bprocessor/build/doc/Changelog,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Changelog 29 Nov 2005 18:52:05 -0000 1.6 --- Changelog 22 Dec 2005 11:34:31 -0000 1.7 *************** *** 2,5 **** --- 2,30 ---- ========== + + 2005/12/22: Release M3 + + Model: + - Restructuring of the internal representation + - More logical coloring of surfaces. + + Camera: + - A lot of camera navigation tools are added: orbit, pan, fly and walk. + + Pencil: + - Bugs fixed in relation to subdividing surfaces. + - Construction lines aids drawing + + Extrusion: + - Bugs removed in relation to space-assignment + - Snapping to parallel surfaces + - Interior surfaces are not extruded, when extruding the exterior + + Construction Line tool added + + Clippingplanes: + - Improved visual apperance + + 2005/11/18: Release M2 ---------------------- |
From: Michael L. <he...@us...> - 2005-12-22 11:20:10
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14045/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Log Message: Splitting bug Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Geometry.java 20 Dec 2005 12:23:14 -0000 1.8 --- Geometry.java 22 Dec 2005 11:19:57 -0000 1.9 *************** *** 161,169 **** Set fromSurfaces = from.getSurfaces(); Set toSurfaces = to.getSurfaces(); Iterator it = fromSurfaces.iterator(); while (it.hasNext()) { Surface current = (Surface) it.next(); if (toSurfaces.contains(current)) { ! exterior = current; } } --- 161,197 ---- Set fromSurfaces = from.getSurfaces(); Set toSurfaces = to.getSurfaces(); + Set shared = new HashSet(); Iterator it = fromSurfaces.iterator(); while (it.hasNext()) { Surface current = (Surface) it.next(); if (toSurfaces.contains(current)) { ! shared.add(current); ! } ! } ! if (shared.size() == 1) { ! exterior = (Surface) shared.iterator().next(); ! } else { ! Iterator iter = shared.iterator(); ! while (iter.hasNext() && (exterior == null)) { ! Surface currentSurface = (Surface) iter.next(); ! if (edges.size() > 1) { ! Vertex currentVertex = first.otherVertex(from); ! int currentIndex = 1; ! Edge currentEdge = (Edge) edges.get(currentIndex); ! boolean outside = false; ! while ((currentVertex != to) && !outside) { ! outside = !currentSurface.surrounds(currentVertex); ! currentVertex = currentEdge.otherVertex(currentVertex); ! currentIndex++; ! if (currentIndex < edges.size()) { ! currentEdge = (Edge) edges.get(currentIndex); ! } else { ! currentEdge = null; ! } ! } ! if (!outside) { ! exterior = currentSurface; ! } ! } } } |