|
From: James M. <jma...@us...> - 2001-11-23 18:52:55
|
Update of /cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/widgets
In directory usw-pr-cvs1:/tmp/cvs-serv3185/uk/ac/leeds/ccg/widgets
Modified Files:
NudgeNavigate.java
Log Message:
added a constructor which takes icons to represent zoom in and out
Index: NudgeNavigate.java
===================================================================
RCS file: /cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/widgets/NudgeNavigate.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** NudgeNavigate.java 2001/11/22 17:22:16 1.4
--- NudgeNavigate.java 2001/11/23 18:52:52 1.5
***************
*** 14,17 ****
--- 14,19 ----
public class NudgeNavigate extends java.awt.Panel {
Viewer view;
+ Image inIcon = null;
+ Image outIcon = null;
/** Creates new form NudgeNavigate */
public NudgeNavigate(Viewer v) {
***************
*** 20,23 ****
--- 22,32 ----
}
+ public NudgeNavigate(Viewer v,Image in,Image out) {
+ initComponents();
+ view = v;
+ inIcon = in;
+ outIcon = out;
+ }
+
/** This method is called from within the constructor to
* initialize the form.
***************
*** 54,98 ****
case NW:
System.out.println("North West");
! center.y+=oldBounds.height/10d;
! center.x-=oldBounds.width/10d;
break;
case N:
System.out.println("North");
! center.y+=oldBounds.height/10d;
break;
case NE:
System.out.println("North East");
! center.y+=oldBounds.height/10d;
! center.x+=oldBounds.width/10d;
break;
case W:
System.out.println("West");
! center.x-=oldBounds.width/10d;
break;
case E:
System.out.println("East");
! center.x+=oldBounds.width/10d;
break;
case SW:
System.out.println("South West");
! center.y-=oldBounds.height/10d;
! center.x-=oldBounds.width/10d;
break;
case S:
System.out.println("South");
! center.y-=oldBounds.height/10d;
break;
case SE:
System.out.println("South East");
! center.y-=oldBounds.height/10d;
! center.x+=oldBounds.width/10d;
break;
case IN:
System.out.println("Zoom In");
! view.zoomPercent(oldPercent+oldPercent/10d);
break;
case OUT:
System.out.println("Zoom Out");
! view.zoomPercent(oldPercent-oldPercent/10d);
break;
default:
--- 63,107 ----
case NW:
System.out.println("North West");
! center.y+=oldBounds.height/3d;
! center.x-=oldBounds.width/3d;
break;
case N:
System.out.println("North");
! center.y+=oldBounds.height/3d;
break;
case NE:
System.out.println("North East");
! center.y+=oldBounds.height/3d;
! center.x+=oldBounds.width/3d;
break;
case W:
System.out.println("West");
! center.x-=oldBounds.width/3d;
break;
case E:
System.out.println("East");
! center.x+=oldBounds.width/3d;
break;
case SW:
System.out.println("South West");
! center.y-=oldBounds.height/3d;
! center.x-=oldBounds.width/3d;
break;
case S:
System.out.println("South");
! center.y-=oldBounds.height/3d;
break;
case SE:
System.out.println("South East");
! center.y-=oldBounds.height/3d;
! center.x+=oldBounds.width/3d;
break;
case IN:
System.out.println("Zoom In");
! view.zoomPercent(oldPercent+oldPercent/2d);
break;
case OUT:
System.out.println("Zoom Out");
! view.zoomPercent(oldPercent-oldPercent/2d);
break;
default:
***************
*** 130,133 ****
--- 139,147 ----
drawArrow(g,wgap+wgap/2,hgap*2+hgap/2,8,wgap);//s
drawArrow(g,wgap*2+wgap/2,hgap*2+hgap/2,7,wgap);//se
+
+ if(inIcon !=null && outIcon!=null){
+ g.drawImage(outIcon,wgap*3+1,1,wgap-2,hgap-2,null);
+ g.drawImage(inIcon,wgap*3+1,hgap*2+1,wgap-2,hgap-2,null);
+ }
|