Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29045/src/net/sourceforge/bprocessor/gl/tool
Modified Files:
ToolFactory.java
Log Message:
added a focusOn button to the toolbar
Index: ToolFactory.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -d -r1.69 -r1.70
*** ToolFactory.java 5 Dec 2006 09:07:25 -0000 1.69
--- ToolFactory.java 29 Dec 2006 13:33:42 -0000 1.70
***************
*** 13,16 ****
--- 13,17 ----
import net.sourceforge.bprocessor.model.Project;
import net.sourceforge.bprocessor.model.Selection;
+ import net.sourceforge.bprocessor.model.Surface;
import java.net.URL;
***************
*** 236,253 ****
Action zoomAction = new ToolAction(glv, 0, "Biconzomeall.gif") {
! public void actionPerformed(ActionEvent agr0) {
! double aspect = glv.getView().getAspect();
! if (Selection.primary().isEmpty()) {
! List list = new LinkedList();
! list.add(Project.getInstance().getActiveSpace());
! Project.getInstance().getCurrentCamera().zoomOn(list, aspect);
! } else {
! Project.getInstance().getCurrentCamera().zoomOn(Selection.primary(), aspect);
! }
! this.glv.repaint();
}
! };
!
Toolbar.getInstance().registerPushButtonAction(zoomAction, "Zoom All");
tb.addSeparator(10);
--- 237,266 ----
Action zoomAction = new ToolAction(glv, 0, "Biconzomeall.gif") {
! public void actionPerformed(ActionEvent agr0) {
! double aspect = glv.getView().getAspect();
! if (Selection.primary().isEmpty()) {
! List list = new LinkedList();
! list.add(Project.getInstance().getActiveSpace());
! Project.getInstance().getCurrentCamera().zoomOn(list, aspect);
! } else {
! Project.getInstance().getCurrentCamera().zoomOn(Selection.primary(), aspect);
}
! this.glv.repaint();
! }
! };
Toolbar.getInstance().registerPushButtonAction(zoomAction, "Zoom All");
+
+ Action focusAction = new ToolAction(glv, 0, "Biconzomeselect.gif") {
+ public void actionPerformed(ActionEvent agr0) {
+ if (Selection.primary().size() == 1) {
+ Object o = Selection.primary().iterator().next();
+ if (o instanceof Surface) {
+ Camera.focusOn(Project.getInstance().getCurrentCamera(), (Surface)o);
+ this.glv.repaint();
+ }
+ }
+ }
+ };
+ Toolbar.getInstance().registerPushButtonAction(focusAction, "Focus on surface");
tb.addSeparator(10);
|