Revision 30100

View differences:

trunk/extensions/extCAD/config/text.properties
345 345
will_be_truncated=ser\u00e1 truncado
346 346
without_limit=Sin l\u00edmite
347 347
yes=Si
348
stop_editing_message=Va a finalizar la edici\u00f3n de una capa que no tiene escritor. Si contin\u00faa perder\u00e1 los cambios a menos que exporte la capa a otro formato. Qu\u00e9 desea hacer?
349
stop_editing_close=Cierre el di\u00e1logo, termine la edici\u00f3n y pierda los cambios.
trunk/extensions/extCAD/config/text_en.properties
346 346
will_be_truncated=Will be truncated
347 347
without_limit=Without limit
348 348
yes=Yes
349
stop_editing_message=You are going to finish an edition of a layer that don't has writer. If you continue, you will lose the changes unless you export the layer to another format. What do you want to do?
350
stop_editing_close=Close the dialog, finish edition and lost changes.
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/CADToolAdapter.java
589 589

  
590 590
		getMapControl().setCursor(transparentCursor);
591 591
	}
592
	
593
	/**
594
	 * Uses like a mouse pointer the image that provides the
595
	 * selected tool.
596
	 */
597
	private void setToolMouse(){
598
		Image cursor = PluginServices.getIconTheme().get("cad-selection-icon").getImage();
599
		Toolkit toolkit = Toolkit.getDefaultToolkit();
600
		Cursor c = toolkit.createCustomCursor(cursor , 
601
				new Point(16, 16), "img");
602
		getMapControl().setCursor (c);
603
	}
592 604

  
593 605
	/**
594 606
	 * <p>Draws a 31x31 pixels cross round the mouse's cursor with an small geometry centered:
......
603 615
	 * @param g <code>MapControl</code>'s graphics where the data will be drawn
604 616
	 */
605 617
	private void drawCursor(Graphics g) {
606
		((Graphics2D)g).setStroke(new BasicStroke(1));
607
		g.setColor(Color.black);
608
		Point2D p = adjustedPoint;
609

  
610
		if (p == null) {
611
			getGrid().setViewPort(getMapControl().getViewPort());
612

  
618
		if (adjustedPoint == null){
613 619
			return;
614 620
		}
615

  
616
		int size1 = 15;
617
		int size2 = 3;
618
		g.drawLine((int) (p.getX() - size1), (int) (p.getY()),
619
				(int) (p.getX() + size1), (int) (p.getY()));
620
		g.drawLine((int) (p.getX()), (int) (p.getY() - size1),
621
				(int) (p.getX()), (int) (p.getY() + size1));
622

  
623
		// getMapControl().setToolTipText(null);
624
		if (adjustedPoint != null) {
625
			if (bForceCoord) {
626
				/* g.setColor(Color.ORANGE);
627
				g.drawRect((int) (adjustedPoint.getX() - 6),
628
						(int) (adjustedPoint.getY() - 6), 12, 12);
629
				g.drawRect((int) (adjustedPoint.getX() - 3),
630
						(int) (adjustedPoint.getY() - 3), 6, 6);
631
				g.setColor(Color.MAGENTA);
632
				g.drawRect((int) (adjustedPoint.getX() - 4),
633
						(int) (adjustedPoint.getY() - 4), 8, 8); */
634
				if (usedSnap != null)
635
				{
636
					usedSnap.draw(g, adjustedPoint);
637

  
638
					Graphics2D g2 = (Graphics2D) g;
639
			        FontMetrics metrics = g2.getFontMetrics();
640
			        int w = metrics.stringWidth(usedSnap.getToolTipText()) + 5;
641
			        int h = metrics.getMaxAscent() + 5;
642
			        int x = (int)p.getX()+9;
643
			        int y = (int)p.getY()- 7;
644

  
645
			        g2.setColor(theTipColor );
646
			        g2.fillRect(x, y-h, w, h);
647
			        g2.setColor(Color.BLACK);
648
			        g2.drawRect(x, y-h, w, h);
649
					g2.drawString(usedSnap.getToolTipText(), x+3, y-3);
650

  
651

  
652
					// getMapControl().setToolTipText(usedSnap.getToolTipText());
653
				}
654

  
655
				bForceCoord = false;
656
			} else {
657
				g.drawRect((int) (p.getX() - size2), (int) (p.getY() - size2),
658
						(int) (size2 * 2), (int) (size2 * 2));
659
			}
621
		
622
		if (usedSnap != null){
623
			usedSnap.draw(g, adjustedPoint);
624
			clearMouseImage();			
625
		}else{
626
			setToolMouse();
660 627
		}
661 628
	}
662 629

  
trunk/extensions/extCAD/src/com/iver/cit/gvsig/CADExtension.java
221 221
				"snapper-icon",
222 222
				CADExtension.class.getClassLoader().getResource(
223 223
						"images/Snapper.png"));
224
		PluginServices.getIconTheme().registerDefault(
225
				"cad-selection-icon",
226
				CADExtension.class.getClassLoader().getResource(
227
						"images/cadselection.png"));
224 228
	}
225 229

  
226 230
	/**

Also available in: Unified diff