[rcpilot-cvs] src/rcpilot/rcgs RcgsMap.java,1.7,1.8
Status: Beta
Brought to you by:
mjpawlowsky
From: Chris S. <cm...@us...> - 2004-06-27 07:39:53
|
Update of /cvsroot/rcpilot/src/rcpilot/rcgs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28174/rcpilot/rcgs Modified Files: RcgsMap.java Log Message: Added zoom buttons to map, but they are non-functional right now Index: RcgsMap.java =================================================================== RCS file: /cvsroot/rcpilot/src/rcpilot/rcgs/RcgsMap.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RcgsMap.java 27 Jun 2004 00:31:30 -0000 1.7 --- RcgsMap.java 27 Jun 2004 07:39:45 -0000 1.8 *************** *** 52,55 **** --- 52,58 ---- private static final String defaultInfoPath = "res/maps/"+defaultMapName+".inf"; + private static final String ZOOM_PLUS_IMAGE_PATH = "res/icons/zoom_plus.jpg"; + private static final String ZOOM_MINUS_IMAGE_PATH = "res/icons/zoom_minus.jpg"; + private Image mapImg, displayImg; *************** *** 82,85 **** --- 85,91 ---- private boolean imgUpdateRequired = true; + private JButton zoomPlusButton; + private JButton zoomMinusButton; + /* * Create the Map Panel and get the last map. *************** *** 94,97 **** --- 100,111 ---- setName("Map"); loadMap(UserPreferences.getMap()); + + setLayout(null); + + zoomPlusButton = new JButton(new ImageIcon(ZOOM_PLUS_IMAGE_PATH)); + zoomMinusButton = new JButton(new ImageIcon(ZOOM_MINUS_IMAGE_PATH)); + + add(zoomPlusButton); + add(zoomMinusButton); } *************** *** 275,279 **** protected void paintComponent(Graphics g) { ! Graphics2D g2 = (Graphics2D) g; Shape plane, home, arrow; --- 289,293 ---- protected void paintComponent(Graphics g) { ! Graphics2D g2 = (Graphics2D) g; Shape plane, home, arrow; *************** *** 291,297 **** --- 305,318 ---- int cropWidth = Math.min(mapImg.getWidth(null), getWidth()); + int cropHeight = Math.min(mapImg.getHeight(null), getHeight()); + // replace literals here + + + zoomPlusButton.setBounds(2,2,34,34); + zoomMinusButton.setBounds(38,2,34,34); + // in hundredths of a second/pixel Hscale = mapHsecs / mapImg.getWidth(null); *************** *** 352,357 **** double homeLatDegrees = (double)homeLatSecs/360000; - displayDebugInfo(); - double asecVPerMile = 5186; double asecHPerMile = 129600000/(24988*Math.cos(Math.toRadians(homeLatDegrees))); --- 373,376 ---- *************** *** 403,407 **** g2.draw(arrow); - g2.dispose(); //clean up } --- 422,425 ---- |