Changeset b0b7d550cde18a78889e74482730fa3519cf8c2d
- Timestamp:
- 02/25/07 10:49:12
(2 years ago)
- Author:
- Christopher Jung <bktheg@web.de>
- git-committer:
- Christopher Jung <bktheg@web.de> 1172396952 +0100
- git-parent:
[44f4abf99b9d7355fdb26123ac777f60ce1caa26]
- git-author:
- Christopher Jung <bktheg@web.de> 1172396952 +0100
- Message:
Einige Warnungen gefixt
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| re5910b8 |
rb0b7d55 |
|
| 35 | 35 | */ |
|---|
| 36 | 36 | class aWindowEntry { |
|---|
| 37 | | public static final int VISIBILITY_OFF = 1; |
|---|
| 38 | | public static final int VISIBILITY_ON = 2; |
|---|
| 39 | | public static final int VISIBILITY_FORCE_OFF = 5; |
|---|
| 40 | | public static final int VISIBILITY_FORCE_ON = 6; |
|---|
| 41 | | public static final int VISIBILITY_FORCE = 4; |
|---|
| | 37 | static final int VISIBILITY_OFF = 1; |
|---|
| | 38 | static final int VISIBILITY_ON = 2; |
|---|
| | 39 | static final int VISIBILITY_FORCE_OFF = 5; |
|---|
| | 40 | static final int VISIBILITY_FORCE_ON = 6; |
|---|
| | 41 | static final int VISIBILITY_FORCE = 4; |
|---|
| 42 | 42 | |
|---|
| 43 | 43 | private int visibility; |
|---|
| … | … | |
| 64 | 64 | private boolean redraw; |
|---|
| 65 | 65 | |
|---|
| 66 | | public aWindowEntry( CanvasWindowManager sm, JWindow aWindow, JWindow aParent ) { |
|---|
| | 66 | aWindowEntry( CanvasWindowManager sm, JWindow aWindow, JWindow aParent ) { |
|---|
| 67 | 67 | visibility = VISIBILITY_OFF; |
|---|
| 68 | 68 | window = aWindow; |
|---|
| … | … | |
| 84 | 84 | } |
|---|
| 85 | 85 | |
|---|
| 86 | | public int getVisibility() { |
|---|
| | 86 | int getVisibility() { |
|---|
| 87 | 87 | return visibility; |
|---|
| 88 | 88 | } |
|---|
| 89 | 89 | |
|---|
| 90 | | public void setVisibility( int vis ) { |
|---|
| | 90 | void setVisibility( int vis ) { |
|---|
| 91 | 91 | visibility = vis; |
|---|
| 92 | 92 | |
|---|
| … | … | |
| 104 | 104 | } |
|---|
| 105 | 105 | |
|---|
| 106 | | public JWindow getWindow() { |
|---|
| | 106 | JWindow getWindow() { |
|---|
| 107 | 107 | return window; |
|---|
| 108 | 108 | } |
|---|
| 109 | 109 | |
|---|
| 110 | | public JWindow getParent() { |
|---|
| | 110 | JWindow getParent() { |
|---|
| 111 | 111 | return parent; |
|---|
| 112 | 112 | } |
|---|
| 113 | 113 | |
|---|
| 114 | | public Shape getShape() { |
|---|
| | 114 | Shape getShape() { |
|---|
| 115 | 115 | return shape; |
|---|
| 116 | 116 | } |
|---|
| 117 | 117 | |
|---|
| 118 | | public void setShape( Shape ashape ) { |
|---|
| | 118 | void setShape( Shape ashape ) { |
|---|
| 119 | 119 | shape = ashape; |
|---|
| 120 | 120 | } |
|---|
| 121 | 121 | |
|---|
| 122 | | public Rectangle getWindowRect() { |
|---|
| | 122 | Rectangle getWindowRect() { |
|---|
| 123 | 123 | return windowRect; |
|---|
| 124 | 124 | } |
|---|
| 125 | 125 | |
|---|
| 126 | | public void setWindowRect(Rectangle rect) { |
|---|
| | 126 | void setWindowRect(Rectangle rect) { |
|---|
| 127 | 127 | windowRect = rect; |
|---|
| 128 | 128 | } |
|---|
| 129 | 129 | |
|---|
| 130 | | public Rectangle getClientRect() { |
|---|
| | 130 | Rectangle getClientRect() { |
|---|
| 131 | 131 | return clientWindowRect; |
|---|
| 132 | 132 | } |
|---|
| 133 | 133 | |
|---|
| 134 | | public void setClientRect(Rectangle rect) { |
|---|
| | 134 | void setClientRect(Rectangle rect) { |
|---|
| 135 | 135 | clientWindowRect = rect; |
|---|
| 136 | 136 | } |
|---|
| 137 | 137 | |
|---|
| 138 | | public Rectangle getVirtualClientRect() { |
|---|
| | 138 | Rectangle getVirtualClientRect() { |
|---|
| 139 | 139 | return virtualClientWindowRect; |
|---|
| 140 | 140 | } |
|---|
| 141 | 141 | |
|---|
| 142 | | public void setVirtualClientRect(Rectangle rect) { |
|---|
| | 142 | void setVirtualClientRect(Rectangle rect) { |
|---|
| 143 | 143 | virtualClientWindowRect = rect; |
|---|
| 144 | 144 | } |
|---|
| 145 | 145 | |
|---|
| 146 | | public Rectangle getMinimalVirtualClientRect() { |
|---|
| | 146 | Rectangle getMinimalVirtualClientRect() { |
|---|
| 147 | 147 | return minVirtualClientWindowRect; |
|---|
| 148 | 148 | } |
|---|
| 149 | 149 | |
|---|
| 150 | | public void setMinimalVirtualClientRect(Rectangle rect) { |
|---|
| | 150 | void setMinimalVirtualClientRect(Rectangle rect) { |
|---|
| 151 | 151 | minVirtualClientWindowRect = rect; |
|---|
| 152 | 152 | } |
|---|
| 153 | 153 | |
|---|
| 154 | | public Rectangle getBorderSize() { |
|---|
| | 154 | Rectangle getBorderSize() { |
|---|
| 155 | 155 | return borderSize; |
|---|
| 156 | 156 | } |
|---|
| 157 | 157 | |
|---|
| 158 | | public void setBorderSize(Rectangle rect) { |
|---|
| | 158 | void setBorderSize(Rectangle rect) { |
|---|
| 159 | 159 | borderSize = rect; |
|---|
| 160 | 160 | } |
|---|
| 161 | 161 | |
|---|
| 162 | | public int getScrollBarHandle() { |
|---|
| | 162 | int getScrollBarHandle() { |
|---|
| 163 | 163 | return scrollBarHandle; |
|---|
| 164 | 164 | } |
|---|
| 165 | 165 | |
|---|
| 166 | | public void setScrollBarHandle( int handle ) { |
|---|
| | 166 | void setScrollBarHandle( int handle ) { |
|---|
| 167 | 167 | scrollBarHandle = handle; |
|---|
| 168 | 168 | } |
|---|
| 169 | 169 | |
|---|
| 170 | | public Point getWindowPosition() { |
|---|
| | 170 | Point getWindowPosition() { |
|---|
| 171 | 171 | return windowPosition; |
|---|
| 172 | 172 | } |
|---|
| 173 | 173 | |
|---|
| 174 | | public Point getRelativeWindowPosition() { |
|---|
| | 174 | Point getRelativeWindowPosition() { |
|---|
| 175 | 175 | return windowRelativePosition; |
|---|
| 176 | 176 | } |
|---|
| 177 | 177 | |
|---|
| 178 | | public void setWindowRelativePosition( Point p ) { |
|---|
| | 178 | void setWindowRelativePosition( Point p ) { |
|---|
| 179 | 179 | windowRelativePosition = p; |
|---|
| 180 | 180 | } |
|---|
| 181 | 181 | |
|---|
| 182 | | public void setWindowPosition( Point p ) { |
|---|
| | 182 | void setWindowPosition( Point p ) { |
|---|
| 183 | 183 | windowPosition = p; |
|---|
| 184 | 184 | } |
|---|
| 185 | 185 | |
|---|
| 186 | | public int getWindowPositionMode() { |
|---|
| | 186 | int getWindowPositionMode() { |
|---|
| 187 | 187 | return windowPositionMode; |
|---|
| 188 | 188 | } |
|---|
| 189 | 189 | |
|---|
| 190 | | public void setWindowPositionMode( int mode ) { |
|---|
| | 190 | void setWindowPositionMode( int mode ) { |
|---|
| 191 | 191 | windowPositionMode = mode; |
|---|
| 192 | 192 | } |
|---|
| 193 | 193 | |
|---|
| 194 | | public Rectangle getVisibleClientRect() { |
|---|
| | 194 | Rectangle getVisibleClientRect() { |
|---|
| 195 | 195 | Rectangle rect = new Rectangle( windowPosition.x+borderSize.x, |
|---|
| 196 | 196 | windowPosition.y+borderSize.y, |
|---|
| … | … | |
| 200 | 200 | } |
|---|
| 201 | 201 | |
|---|
| 202 | | public int mapX( int absX ) { |
|---|
| | 202 | int mapX( int absX ) { |
|---|
| 203 | 203 | absX -= windowPosition.x; |
|---|
| 204 | 204 | absX -= borderSize.x; |
|---|
| … | … | |
| 207 | 207 | } |
|---|
| 208 | 208 | |
|---|
| 209 | | public int mapY( int absY ) { |
|---|
| | 209 | int mapY( int absY ) { |
|---|
| 210 | 210 | absY -= windowPosition.y; |
|---|
| 211 | 211 | absY -= borderSize.y; |
|---|
| … | … | |
| 231 | 231 | } |
|---|
| 232 | 232 | |
|---|
| 233 | | public int getVScrollOffset() { |
|---|
| | 233 | int getVScrollOffset() { |
|---|
| 234 | 234 | return vScrollOffset; |
|---|
| 235 | 235 | } |
|---|
| 236 | 236 | |
|---|
| 237 | | public void setVScrollOffset( int offset ) { |
|---|
| | 237 | void setVScrollOffset( int offset ) { |
|---|
| 238 | 238 | vScrollOffset = offset; |
|---|
| 239 | 239 | } |
|---|
| 240 | 240 | |
|---|
| 241 | | public boolean isScrollable() { |
|---|
| | 241 | boolean isScrollable() { |
|---|
| 242 | 242 | return enableScrolling; |
|---|
| 243 | 243 | } |
|---|
| 244 | 244 | |
|---|
| 245 | | public void setScrollable( boolean scroll ) { |
|---|
| | 245 | void setScrollable( boolean scroll ) { |
|---|
| 246 | 246 | enableScrolling = scroll; |
|---|
| 247 | 247 | } |
|---|
| 248 | 248 | |
|---|
| 249 | | public void setOffscreenBuffer( BufferedImage img ) { |
|---|
| | 249 | void setOffscreenBuffer( BufferedImage img ) { |
|---|
| 250 | 250 | offscreenBuffer = img; |
|---|
| 251 | 251 | } |
|---|
| 252 | 252 | |
|---|
| 253 | | public BufferedImage getOffscreenBuffer() { |
|---|
| | 253 | BufferedImage getOffscreenBuffer() { |
|---|
| 254 | 254 | return offscreenBuffer; |
|---|
| 255 | 255 | } |
|---|
| 256 | 256 | |
|---|
| 257 | | public boolean getRedrawStatus() { |
|---|
| | 257 | boolean getRedrawStatus() { |
|---|
| 258 | 258 | return redraw; |
|---|
| 259 | 259 | } |
|---|
| 260 | 260 | |
|---|
| 261 | | public void setRedrawStatus( boolean redraw ) { |
|---|
| | 261 | void setRedrawStatus( boolean redraw ) { |
|---|
| 262 | 262 | this.redraw = redraw; |
|---|
| 263 | 263 | } |
|---|
| re5910b8 |
rb0b7d55 |
|
| 52 | 52 | */ |
|---|
| 53 | 53 | public class MapConnector implements ServerConnectable { |
|---|
| | 54 | /** |
|---|
| | 55 | * Der Service-Name |
|---|
| | 56 | */ |
|---|
| 54 | 57 | public static final String SERVICE = MapConnector.class.getName(); |
|---|
| 55 | 58 | |
|---|
| … | … | |
| 57 | 60 | private String mapDescription[][]; |
|---|
| 58 | 61 | private String mapLargeObjects[][]; |
|---|
| 59 | | private Stack mapLargeObjectsPrecache; |
|---|
| | 62 | private Stack<String> mapLargeObjectsPrecache; |
|---|
| 60 | 63 | private int nSystem; |
|---|
| 61 | 64 | private int mapWidth; |
|---|
| … | … | |
| 67 | 70 | private boolean bMapLoaded; |
|---|
| 68 | 71 | |
|---|
| 69 | | private Vector notifyWindowList; |
|---|
| | 72 | private Vector<JWindow> notifyWindowList; |
|---|
| 70 | 73 | |
|---|
| 71 | 74 | private static final int PROTOCOL = 8; |
|---|
| … | … | |
| 74 | 77 | private static final int ADDDATA_LARGE_OBJECT = 2; |
|---|
| 75 | 78 | |
|---|
| | 79 | /** |
|---|
| | 80 | * Ein Sektor mit eigenen Schiffen |
|---|
| | 81 | */ |
|---|
| 76 | 82 | public static final int SECTOR_OWN_SHIPS = 1; |
|---|
| | 83 | /** |
|---|
| | 84 | * Ein Sektor mit alliierten Schiffen |
|---|
| | 85 | */ |
|---|
| 77 | 86 | public static final int SECTOR_ALLY_SHIPS = 2; |
|---|
| | 87 | /** |
|---|
| | 88 | * Ein Sektor mit feindlichen Schiffen |
|---|
| | 89 | */ |
|---|
| 78 | 90 | public static final int SECTOR_ENEMY_SHIPS = 3; |
|---|
| 79 | 91 | |
|---|
| | 92 | /** |
|---|
| | 93 | * Konstruktor |
|---|
| | 94 | * |
|---|
| | 95 | */ |
|---|
| 80 | 96 | public MapConnector() { |
|---|
| 81 | 97 | bMapLoaded = false; |
|---|
| … | … | |
| 84 | 100 | currentUser = 0; |
|---|
| 85 | 101 | |
|---|
| 86 | | notifyWindowList = new Vector(); |
|---|
| 87 | | |
|---|
| 88 | | mapLargeObjectsPrecache = new Stack(); |
|---|
| | 102 | notifyWindowList = new Vector<JWindow>(); |
|---|
| | 103 | |
|---|
| | 104 | mapLargeObjectsPrecache = new Stack<String>(); |
|---|
| 89 | 105 | } |
|---|
| 90 | 106 | |
|---|
| … | … | |
| 409 | 425 | // Alle eingetragenen Fenster informieren, dass wir jetzt fertig sind |
|---|
| 410 | 426 | for( int i=0; i < notifyWindowList.size(); i++ ) { |
|---|
| 411 | | JWindow wnd = (JWindow)notifyWindowList.get(i); |
|---|
| | 427 | JWindow wnd = notifyWindowList.get(i); |
|---|
| 412 | 428 | wnd.handleEvent(wnd.getHandle(), "map_changed" ); |
|---|
| 413 | 429 | } |
|---|
| … | … | |
| 595 | 611 | return true; |
|---|
| 596 | 612 | } |
|---|
| 597 | | else { |
|---|
| 598 | | return false; |
|---|
| 599 | | } |
|---|
| | 613 | return false; |
|---|
| 600 | 614 | } |
|---|
| 601 | 615 | else if( property == SECTOR_ALLY_SHIPS ) { |
|---|
| … | … | |
| 603 | 617 | return true; |
|---|
| 604 | 618 | } |
|---|
| 605 | | else { |
|---|
| 606 | | return false; |
|---|
| 607 | | } |
|---|
| | 619 | return false; |
|---|
| 608 | 620 | } |
|---|
| 609 | 621 | else if( property == SECTOR_ENEMY_SHIPS ) { |
|---|
| … | … | |
| 611 | 623 | return true; |
|---|
| 612 | 624 | } |
|---|
| 613 | | else { |
|---|
| 614 | | return false; |
|---|
| 615 | | } |
|---|
| | 625 | return false; |
|---|
| 616 | 626 | } |
|---|
| 617 | 627 | |
|---|
| … | … | |
| 629 | 639 | public void precacheImages(JImageCache imagecache ) { |
|---|
| 630 | 640 | while( !mapLargeObjectsPrecache.empty() ) { |
|---|
| 631 | | String text = (String)mapLargeObjectsPrecache.pop(); |
|---|
| | 641 | String text = mapLargeObjectsPrecache.pop(); |
|---|
| 632 | 642 | |
|---|
| 633 | 643 | BufferedImage masterimg = imagecache.loadImage("starmap/"+text+"_precache.png"); |
|---|
| r084f1ea |
rb0b7d55 |
|
| 37 | 37 | |
|---|
| 38 | 38 | public class SoapConnector implements ServerConnectable { |
|---|
| | 39 | /** |
|---|
| | 40 | * Der Service-Name |
|---|
| | 41 | */ |
|---|
| 39 | 42 | public static final String SERVICE = SoapConnector.class.getName(); |
|---|
| 40 | 43 | |
|---|
| … | … | |
| 171 | 174 | } |
|---|
| 172 | 175 | |
|---|
| | 176 | /** |
|---|
| | 177 | * Der Uservalue fuer das gepufferte Zeichnen auf dem Bildschirm |
|---|
| | 178 | */ |
|---|
| 173 | 179 | public static final String USERVALUE_STARMAP_BUFFEREDOUTPUT = "TBLORDER/clients/jstarmap/bufferedoutput"; // 1 oder 0 |
|---|
| 174 | 180 | |
|---|
| re5910b8 |
rb0b7d55 |
|
| 38 | 38 | */ |
|---|
| 39 | 39 | public class XMLConnector implements ServerConnectable { |
|---|
| | 40 | /** |
|---|
| | 41 | * Der Service-Name |
|---|
| | 42 | */ |
|---|
| 40 | 43 | public static final String SERVICE = XMLConnector.class.getName(); |
|---|
| 41 | 44 | |
|---|
| … | … | |
| 55 | 58 | |
|---|
| 56 | 59 | /** |
|---|
| 57 | | * Ruft eine DS-URL auf und gibt sie als XML-Dokument zurueck. Anders als bei {@see #fetchStyledURL(String, String, String)} |
|---|
| | 60 | * Ruft eine DS-URL auf und gibt sie als XML-Dokument zurueck. Anders als bei {@link #fetchStyledURL(String, String, String)} |
|---|
| 58 | 61 | * wird nicht versucht eine alternative XML-Ausgabe zu bekommen |
|---|
| 59 | 62 | * |
|---|
| re5910b8 |
rb0b7d55 |
|
| 20 | 20 | package net.driftingsouls.ds2.framework.services; |
|---|
| 21 | 21 | |
|---|
| | 22 | /** |
|---|
| | 23 | * Kapselt einen Fehler im XMLConnector |
|---|
| | 24 | * @author Christopher Jung |
|---|
| | 25 | * |
|---|
| | 26 | */ |
|---|
| 22 | 27 | public class XMLConnectorException extends Exception { |
|---|
| 23 | 28 | private static final long serialVersionUID = -4209104899616795575L; |
|---|
| 24 | 29 | |
|---|
| | 30 | /** |
|---|
| | 31 | * Konstruktor |
|---|
| | 32 | * @param cause Der eigendliche Fehler |
|---|
| | 33 | */ |
|---|
| 25 | 34 | public XMLConnectorException(Throwable cause) { |
|---|
| 26 | 35 | super(cause); |
|---|
| re5910b8 |
rb0b7d55 |
|
| 34 | 34 | */ |
|---|
| 35 | 35 | public class JAboutDialog extends JDialog { |
|---|
| 36 | | private boolean autoHeight; |
|---|
| | 36 | //private boolean autoHeight; |
|---|
| 37 | 37 | private JTextField textfield; |
|---|
| 38 | 38 | |
|---|
| | 39 | /** |
|---|
| | 40 | * Konstruktor |
|---|
| | 41 | * @param parent Das Elternfenster |
|---|
| | 42 | * @param windowmanager Der Fenstermanager |
|---|
| | 43 | * @param myfont Die zu verwendende Font |
|---|
| | 44 | */ |
|---|
| 39 | 45 | public JAboutDialog( JWindow parent, IWindowManager windowmanager, String myfont ) { |
|---|
| 40 | 46 | super( parent, windowmanager ); |
|---|
| 41 | 47 | |
|---|
| 42 | | autoHeight = false; |
|---|
| | 48 | //autoHeight = false; |
|---|
| 43 | 49 | |
|---|
| 44 | 50 | textfield = new JTextField( this, windowmanager, myfont ); |
|---|
| … | … | |
| 47 | 53 | } |
|---|
| 48 | 54 | |
|---|
| | 55 | /** |
|---|
| | 56 | * Setzt den anzuzeigenden Text |
|---|
| | 57 | * @param text Der anzuzeigende Text |
|---|
| | 58 | */ |
|---|
| 49 | 59 | public void setText( String text ) { |
|---|
| 50 | 60 | textfield.setText( text ); |
|---|
| 51 | 61 | } |
|---|
| 52 | 62 | |
|---|
| | 63 | @Override |
|---|
| 53 | 64 | public void setSize( int width, int height ) { |
|---|
| 54 | 65 | super.setSize(width,height); |
|---|
| … | … | |
| 57 | 68 | } |
|---|
| 58 | 69 | |
|---|
| | 70 | @Override |
|---|
| 59 | 71 | public void setClientSize( int width, int height ) { |
|---|
| 60 | 72 | super.setClientSize(width,height); |
|---|
| … | … | |
| 63 | 75 | } |
|---|
| 64 | 76 | |
|---|
| | 77 | @Override |
|---|
| 65 | 78 | public boolean mousePressed( int x, int y, int button ) { |
|---|
| 66 | 79 | boolean result = super.mousePressed(x, y, button); |
|---|
| re5910b8 |
rb0b7d55 |
|
| 63 | 63 | private boolean isAdmin; |
|---|
| 64 | 64 | |
|---|
| | 65 | /** |
|---|
| | 66 | * Konstruktor |
|---|
| | 67 | * @param parent Das Elternfenster |
|---|
| | 68 | * @param windowmanager Der Fenstermanager |
|---|
| | 69 | * @param aMap Der Map-Connector |
|---|
| | 70 | */ |
|---|
| 65 | 71 | public JConfigureDialog(JWindow parent, IWindowManager windowmanager, MapConnector aMap ) { |
|---|
| 66 | 72 | super(parent, windowmanager); |
|---|
| … | … | |
| 155 | 161 | } |
|---|
| 156 | 162 | |
|---|
| | 163 | @Override |
|---|
| 157 | 164 | public boolean handleEvent( int handle, String event ) { |
|---|
| 158 | 165 | boolean result = super.handleEvent( handle, event ); |
|---|
| … | … | |
| 180 | 187 | } |
|---|
| 181 | 188 | |
|---|
| | 189 | @Override |
|---|
| 182 | 190 | public boolean mousePressed( int x, int y, int button ) { |
|---|
| 183 | 191 | boolean result = super.mousePressed(x, y, button); |
|---|
| … | … | |
| 200 | 208 | } |
|---|
| 201 | 209 | |
|---|
| | 210 | @Override |
|---|
| 202 | 211 | public void paint( Graphics2D g ) { |
|---|
| 203 | 212 | super.paint(g); |
|---|
| re5910b8 |
rb0b7d55 |
|
| 49 | 49 | private JButton addInfoButton; |
|---|
| 50 | 50 | |
|---|
| | 51 | /** |
|---|
| | 52 | * Konstruktor |
|---|
| | 53 | * @param parent Das Elternfenster |
|---|
| | 54 | * @param windowmanager Der Fenstermanager |
|---|
| | 55 | * @param myfont Der zu verwendende Font |
|---|
| | 56 | * @param map Der Map-Connector |
|---|
| | 57 | */ |
|---|
| 51 | 58 | public JInfoDialog( JWindow parent, IWindowManager windowmanager, String myfont, MapConnector map ) { |
|---|
| 52 | 59 | super( parent, windowmanager ); |
|---|
| … | … | |
| 65 | 72 | } |
|---|
| 66 | 73 | |
|---|
| | 74 | /** |
|---|
| | 75 | * Setzt den anzuzeigenden Sektor |
|---|
| | 76 | * @param x Die x-Koordinate des DS-Sektors |
|---|
| | 77 | * @param y Die y-Koordinate des DS-Sektors |
|---|
| | 78 | */ |
|---|
| 67 | 79 | public void setSector( int x, int y ) { |
|---|
| 68 | 80 | currentX = x; |
|---|
| … | … | |
| 99 | 111 | } |
|---|
| 100 | 112 | |
|---|
| | 113 | /** |
|---|
| | 114 | * Setzt die automatische Hoehenanpassung |
|---|
| | 115 | * @param value <code>true</code>, wenn die automatische Hoehenanpassung aktiviert werden soll |
|---|
| | 116 | */ |
|---|
| 101 | 117 | public void setAutoHeight( boolean value ) { |
|---|
| 102 | 118 | if( value ) { |
|---|
| … | … | |
| 110 | 126 | } |
|---|
| 111 | 127 | |
|---|
| | 128 | @Override |
|---|
| 112 | 129 | public void onResize() { |
|---|
| 113 | 130 | if( addInfoButton != null ) { |
|---|
| … | … | |
| 131 | 148 | } |
|---|
| 132 | 149 | |
|---|
| | 150 | @Override |
|---|
| 133 | 151 | public boolean handleEvent( int handle, String event ) { |
|---|
| 134 | 152 | boolean result = super.handleEvent( handle, event ); |
|---|
| … | … | |
| 158 | 176 | } |
|---|
| 159 | 177 | |
|---|
| | 178 | @Override |
|---|
| 160 | 179 | public boolean mousePressed( int x, int y, int button ) { |
|---|
| 161 | 180 | boolean result = super.mousePressed(x, y, button); |
|---|
| … | … | |
| 170 | 189 | } |
|---|
| 171 | 190 | |
|---|
| | 191 | @Override |
|---|
| 172 | 192 | public void paint(Graphics2D g) { |
|---|
| 173 | 193 | super.paint(g); |
|---|
| re5910b8 |
rb0b7d55 |
|
| 43 | 43 | private JConfigureDialog dlgConfigure; |
|---|
| 44 | 44 | |
|---|
| | 45 | /** |
|---|
| | 46 | * Konstruktor |
|---|
| | 47 | * @param parent Das Elternfenster |
|---|
| | 48 | * @param windowmanager Der Fenstermanager |
|---|
| | 49 | * @param map Der Map-Connector |
|---|
| | 50 | */ |
|---|
| 45 | 51 | public JMapContextDialog(JWindow parent, IWindowManager windowmanager, MapConnector map ) { |
|---|
| 46 | 52 | super(parent, windowmanager); |
|---|
| … | … | |
| 77 | 83 | } |
|---|
| 78 | 84 | |
|---|
| | 85 | @Override |
|---|
| 79 | 86 | public boolean handleEvent( int handle, String event ) { |
|---|
| 80 | 87 | boolean result = super.handleEvent( handle, event ); |
|---|
| … | … | |
| 112 | 119 | } |
|---|
| 113 | 120 | |
|---|
| | 121 | @Override |
|---|
| 114 | 122 | public boolean mousePressed( int x, int y, int button ) { |
|---|
| 115 | 123 | boolean result = super.mousePressed(x, y, button); |
|---|
| re5910b8 |
rb0b7d55 |
|
| 46 | 46 | private JInfoDialog dlgToolTip; |
|---|
| 47 | 47 | private JMapContextDialog dlgMapContext; |
|---|
| 48 | | private Vector mapImageList; |
|---|
| | 48 | protected Vector<String> mapImageList; |
|---|
| 49 | 49 | |
|---|
| 50 | 50 | private int xOffset; |
|---|
| 51 | 51 | private int yOffset; |
|---|
| 52 | | private int oldXOffset; |
|---|
| 53 | | private int oldYOffset; |
|---|
| 54 | | |
|---|
| 55 | | private int mapXOffset; |
|---|
| 56 | | private int mapYOffset; |
|---|
| | 52 | //private int oldXOffset; |
|---|
| | 53 | //private int oldYOffset; |
|---|
| | 54 | |
|---|
| | 55 | //private int mapXOffset; |
|---|
| | 56 | //private int mapYOffset; |
|---|
| 57 | 57 | |
|---|
| 58 | 58 | private int lastX; |
|---|
| 59 | 59 | private int lastY; |
|---|
| 60 | 60 | |
|---|
| 61 | | private MapConnector map; |
|---|
| | 61 | protected MapConnector map; |
|---|
| 62 | 62 | |
|---|
| 63 | 63 | private int currentZoom; |
|---|
| 64 | 64 | |
|---|
| | 65 | /** |
|---|
| | 66 | * Konstruktor |
|---|
| | 67 | * @param parent Das Elternfenster |
|---|
| | 68 | * @param windowmanager Der Fenstermanager |
|---|
| | 69 | * @param map Der Map-Connector |
|---|
| | 70 | */ |
|---|
| 65 | 71 | public JMapViewer( JWindow parent, IWindowManager windowmanager, MapConnector map ) { |
|---|
| 66 | 72 | super( parent, windowmanager ); |
|---|
| … | … | |
| 72 | 78 | xOffset = 0; |
|---|
| 73 | 79 | yOffset = 0; |
|---|
| 74 | | oldXOffset = 0; |
|---|
| | 80 | /*oldXOffset = 0; |
|---|
| 75 | 81 | oldYOffset = 0; |
|---|
| 76 | 82 | mapXOffset = 0; |
|---|
| 77 | | mapYOffset = 0; |
|---|
| | 83 | mapYOffset = 0;*/ |
|---|
| 78 | 84 | lastX = 0; |
|---|
| 79 | 85 | lastY = 0; |
|---|
| … | … | |
| 97 | 103 | try { |
|---|
| 98 | 104 | if( mapImageList == null ) { |
|---|
| 99 | | mapImageList = new Vector(); |
|---|
| | 105 | mapImageList = new Vector<String>(); |
|---|
| 100 | 106 | |
|---|
| 101 | 107 | for( int tmpy=0; tmpy < map.getHeight(); tmpy++ ) { |
|---|
| … | … | |
| 111 | 117 | |
|---|
| 112 | 118 | for( int i=0; i < mapImageList.size(); i++ ) { |
|---|
| 113 | | String file = (String)mapImageList.get(i); |
|---|
| | 119 | String file = mapImageList.get(i); |
|---|
| 114 | 120 | |
|---|
| 115 | 121 | getImageCache().dropImages(file+"#"+oldTileSize+"_"+oldTileSize); |
|---|
| … | … | |
| 124 | 130 | } |
|---|
| 125 | 131 | |
|---|
| | 132 | @Override |
|---|
| 126 | 133 | public boolean handleEvent( int handle, String event ) { |
|---|
| 127 | 134 | boolean result = super.handleEvent( handle, event ); |
|---|
| … | … | |
| 137 | 144 | } |
|---|
| 138 | 145 | |
|---|
| | 146 | /** |
|---|
| | 147 | * Gibt den aktuellen Zoom der Karte zurueck |
|---|
| | 148 | * @return Der aktuelle Zoom |
|---|
| | 149 | */ |
|---|
| 139 | 150 | public int getCurrentZoom() { |
|---|
| 140 | 151 | return currentZoom; |
|---|
| 141 | 152 | } |
|---|
| 142 | 153 | |
|---|
| 143 | | /* |
|---|
| 144 | | * zoomMap |
|---|
| 145 | | * Die Karte zoomen. factor enthÀlt hierbei den entsprechenden Faktor |
|---|
| 146 | | * factor=100 wÀren z.B. 100% (NormalgröÃe) |
|---|
| 147 | | * x und y enthalten die Fensterkoordinate, um die gezoomt werden soll |
|---|
| | 154 | /** |
|---|
| | 155 | * Zoomt die Karte um einen bestimmten Faktor um eine Koordinate des Fensters herum |
|---|
| | 156 | * @param factor der Faktor um den gezoomt werden soll (100 = Normalgroesse, 100%) |
|---|
| | 157 | * @param x Die X-Koordinate im Fenster auf die gezoomt werden soll |
|---|
| | 158 | * @param y Die Y-Koordinate im Fenster auf die gezoomt werden soll |
|---|
| 148 | 159 | * |
|---|
| 149 | 160 | */ |
|---|
| 150 | | |
|---|
| 151 | 161 | public void zoomMap( int factor, int x, int y ) { |
|---|
| 152 | 162 | if( factor < 1 ) { |
|---|
| … | … | |
| 172 | 182 | tilesizeY = newTileSize; |
|---|
| 173 | 183 | |
|---|
| 174 | | oldXOffset = 0; |
|---|
| 175 | | oldYOffset = 0; |
|---|
| | 184 | //oldXOffset = 0; |
|---|
| | 185 | //oldYOffset = 0; |
|---|
| 176 | 186 | } |
|---|
| 177 | 187 | |
|---|
| … | … | |
| 200 | 210 | } |
|---|
| 201 | 211 | |
|---|
| | 212 | @Override |
|---|
| 202 | 213 | public boolean mousePressed( int x, int y, int button ) { |
|---|
| 203 | 214 | boolean result = super.mousePressed(x, y, button); |
|---|
| … | … | |
| 247 | 258 | } |
|---|
| 248 | 259 | |
|---|
| | 260 | @Override |
|---|
| 249 | 261 | public boolean mouseDragged( int x, int y, int button ) { |
|---|
| 250 | 262 | boolean result = super.mouseDragged( x, y, button ); |
|---|
| … | … | |
| 258 | 270 | } |
|---|
| 259 | 271 | |
|---|
| 260 | | oldXOffset = xOffset; |
|---|
| 261 | | oldYOffset = yOffset; |
|---|
| | 272 | //oldXOffset = xOffset; |
|---|
| | 273 | //oldYOffset = yOffset; |
|---|
| 262 | 274 | |
|---|
| 263 | 275 | xOffset += x - lastX; |
|---|
| … | … | |
| 288 | 300 | } |
|---|
| 289 | 301 | |
|---|
| | 302 | @Override |
|---|
| 290 | 303 | public boolean keyPressed( int keycode, char key ) { |
|---|
| 291 | 304 | if( key == 'z' ) { |
|---|
| … | … | |
| 298 | 311 | return true; |
|---|
| 299 | 312 | } |
|---|
| 300 | | else { |
|---|
| 301 | | return super.keyPressed(keycode,key); |
|---|
| 302 | | } |
|---|
| 303 | | } |
|---|
| 304 | | |
|---|
| 305 | | public void drawMap(Graphics2D g) { |
|---|
| | 313 | |
|---|
| | 314 | return super.keyPressed(keycode,key); |
|---|
| | 315 | } |
|---|
| | 316 | |
|---|
| | 317 | /** |
|---|
| | 318 | * Zeichnet die Karte |
|---|
| | 319 | * @param g Der Zeichenkontext in dem gezeichnet werden soll |
|---|
| | 320 | */ |
|---|
| | 321 | protected void drawMap(Graphics2D g) { |
|---|
| 306 | 322 | int xbase = 1; |
|---|
| 307 | 323 | int ybase = 1; |
|---|
| … | … | |
| 467 | 483 | } |
|---|
| 468 | 484 | |
|---|
| | 485 | @Override |
|---|
| 469 | 486 | public void paint(Graphics2D g) { |
|---|
| 470 | 487 | super.paint(g); |
|---|
| re5910b8 |
rb0b7d55 |
|
| 42 | 42 | */ |
|---|
| 43 | 43 | public class JSectorInfoDialog extends JDialog implements IImageStatusNotifier { |
|---|
| 44 | | private Vector shipPanels; |
|---|
| | 44 | private Vector<JShipInfo> shipPanels; |
|---|
| 45 | 45 | private String fontName; |
|---|
| 46 | 46 | |
|---|
| | 47 | /** |
|---|
| | 48 | * Konstruktor |
|---|
| | 49 | * @param parent Das Elternfenster |
|---|
| | 50 | * @param windowmanager Der Fenstermanager |
|---|
| | 51 | * @param fontname Die zum Zeichnen zu verwendende Font |
|---|
| | 52 | */ |
|---|
| 47 | 53 | public JSectorInfoDialog( JWindow parent, IWindowManager windowmanager, String fontname ) { |
|---|
| 48 | 54 | super( parent, windowmanager ); |
|---|
| … | … | |
| 50 | 56 | fontName = fontname; |
|---|
| 51 | 57 | |
|---|
| 52 | | shipPanels = new Vector(); |
|---|
| | 58 | shipPanels = new Vector<JShipInfo>(); |
|---|
| 53 | 59 | } |
|---|
| 54 | 60 | |
|---|
| … | … | |
| 91 | 97 | } |
|---|
| 92 | 98 | |
|---|
| | 99 | /** |
|---|
| | 100 | * Setzt das XML-Dokument, welches die anzuzeigenden Daten enthaelt |
|---|
| | 101 | * @param doc Das XML-Dokument mit den anzuzeigenden Daten |
|---|
| | 102 | */ |
|---|
| 93 | 103 | public void setDocumentSource( Document doc ) { |
|---|
| 94 | 104 | for( int i=0; i < shipPanels.size(); i++ ) { |
|---|
| 95 | | ((JShipInfo)shipPanels.get(i)).dispose(); |
|---|
| 96 | | } |
|---|
| 97 | | shipPanels = new Vector(); |
|---|
| | 105 | shipPanels.get(i).dispose(); |
|---|
| | 106 | } |
|---|
| | 107 | shipPanels.clear(); |
|---|
| 98 | 108 | |
|---|
| 99 | 109 | int y = 0; |
|---|
| … | … | |
| 113 | 123 | shipinfo.setProperty("relation", rel); |
|---|
| 114 | 124 | |
|---|
| 115 | | Attr id = ship.getAttributeNode("id"); |
|---|
| | 125 | //Attr id = ship.getAttributeNode("id"); |
|---|
| 116 | 126 | |
|---|
| 117 | 127 | NodeList elements = ship.getChildNodes(); |
|---|
| … | … | |
| 187 | 197 | |
|---|
| 188 | 198 | for( int i=0; i < shipPanels.size(); i++ ) { |
|---|
| 189 | | JShipInfo shipinfo = (JShipInfo)shipPanels.get(i); |
|---|
| | 199 | JShipInfo shipinfo = shipPanels.get(i); |
|---|
| 190 | 200 | |
|---|
| 191 | 201 | shipinfo.setPosition(0,y); |
|---|
| … | … | |
| 204 | 214 | } |
|---|
| 205 | 215 | |
|---|
| | 216 | @Override |
|---|
| 206 | 217 | public boolean mousePressed( int x, int y, int button ) { |
|---|
| 207 | 218 | boolean result = super.mousePressed( x, y, button ); |
|---|
| … | … | |
| 216 | 227 | } |
|---|
| 217 | 228 | |
|---|
| | 229 | @Override |
|---|
| 218 | 230 | public void paint( Graphics2D g ) { |
|---|
| 219 | 231 | super.paint(g); |
|---|