Revision 9392 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/gui/MapProperties.java

View differences:

MapProperties.java
122 122
        getTxtOwner().setText(map.getOwner());
123 123
        getTxtComments().setText(map.getComment());
124 124

  
125
        getTxtHorizontal().setText(Double.toString(map.getModel().getAtributes().getNumUnitsX()));
126
        getTxtVertical().setText(Double.toString(map.getModel().getAtributes().getNumUnitsY()));
125
        getTxtHorizontal().setText(Double.toString(map.getModel().getLayoutContext().getAtributes().getNumUnitsX()));
126
        getTxtVertical().setText(Double.toString(map.getModel().getLayoutContext().getAtributes().getNumUnitsY()));
127 127

  
128
        getChkActiveGrid().setSelected(map.getModel().isAdjustingToGrid());
128
        getChkActiveGrid().setSelected(map.getModel().getLayoutContext().isAdjustingToGrid());
129 129
   		//map.getModel().setProjectMap(map);
130 130
	}
131 131

  
......
533 533
	private javax.swing.JLabel getJLabel8() {
534 534
		if(jLabel8 == null) {
535 535
			jLabel8 = new javax.swing.JLabel();
536
			jLabel8.setText(PluginServices.getText(this,map.getModel().getAtributes().getNameUnit()));
536
			jLabel8.setText(PluginServices.getText(this,map.getModel().getLayoutContext().getAtributes().getNameUnit()));
537 537
		}
538 538
		return jLabel8;
539 539
	}
......
547 547
			activeRuler = new javax.swing.JCheckBox();
548 548
			activeRuler.setText(PluginServices.getText(this,"activar_regla"));
549 549
			activeRuler.setPreferredSize(new java.awt.Dimension(190,24));
550
			activeRuler.setSelected(map.getModel().getRuler());
550
			activeRuler.setSelected(map.getModel().getLayoutContext().getRuler());
551 551
			activeRuler.addActionListener(new java.awt.event.ActionListener() {
552 552
				public void actionPerformed(java.awt.event.ActionEvent e) {
553 553
					//map.getModel().setRuler(jCheckBox.isSelected());
......
583 583
	private JCheckBox getChbShowGrid() {
584 584
		if (showGrid == null) {
585 585
			showGrid = new JCheckBox();
586
			showGrid.setSelected(map.getModel().getGridVisible());
586
			showGrid.setSelected(map.getModel().getLayoutContext().isGridVisible());
587 587
			showGrid.setPreferredSize(new java.awt.Dimension(190,24));
588 588
			showGrid.setText(PluginServices.getText(this,"visualizar_cuadricula"));
589 589
			showGrid.addActionListener(new java.awt.event.ActionListener() {
......
608 608
	private JCheckBox getChbEditable() {
609 609
		if (chbEditable == null) {
610 610
			chbEditable = new JCheckBox();
611
			chbEditable.setSelected(map.getModel().isEditable());
611
			chbEditable.setSelected(map.getModel().getLayoutContext().isEditable());
612 612
			chbEditable.setPreferredSize(new java.awt.Dimension(190,24));
613 613
			chbEditable.setText(PluginServices.getText(this,"editable"));
614 614
		}
......
622 622
					map.setName(txtName.getText());
623 623
                    map.setOwner(txtOwner.getText());
624 624
                    map.setComment(txtComments.getText());
625
                    map.getModel().setAdjustToGrid(chkActiveGrid.isSelected());
626
                    map.getModel().setGridVisible(showGrid.isSelected());
627
                 	map.getModel().setRuler(activeRuler.isSelected());
628
                    map.getModel().setEditable(chbEditable.isSelected());
625
                    map.getModel().getLayoutContext().setAdjustToGrid(chkActiveGrid.isSelected());
626
                    map.getModel().getLayoutContext().setGridVisible(showGrid.isSelected());
627
                 	map.getModel().getLayoutContext().setRuler(activeRuler.isSelected());
628
                    map.getModel().getLayoutContext().setEditable(chbEditable.isSelected());
629 629
                 	try {
630 630
                     	String sh=txtHorizontal.getText();
631 631
                     	sh=sh.replace(',','.');
632 632
                     	if (sh.length()!=0){
633 633
                         	double f = new Double(sh).doubleValue();
634
								map.getModel().getAtributes().setNumUnitsX(f);
634
								map.getModel().getLayoutContext().getAtributes().setNumUnitsX(f);
635 635
                     	}
636 636

  
637 637
							String sv=txtVertical.getText();
638 638
							sv=sv.replace(',','.');
639 639
							if (sv.length()!=0){
640 640
								double f = new Double(sv).doubleValue();
641
								map.getModel().getAtributes().setNumUnitsY(f);
641
								map.getModel().getLayoutContext().getAtributes().setNumUnitsY(f);
642 642
							}
643 643

  
644 644
							PluginServices.getMDIManager().closeWindow(MapProperties.this);
645
							map.getModel().setGridVisible(getChbShowGrid().isSelected());
646
							map.getModel().refresh();
645
							map.getModel().getLayoutContext().setGridVisible(getChbShowGrid().isSelected());
646
							IWindow win=PluginServices.getMDIManager().getActiveWindow();
647
							if (win instanceof Layout) {
648
								((Layout)win).getLayoutControl().refresh();
649
							}
647 650
                     } catch (NumberFormatException ex) {
648 651
                         NotificationManager.addInfo("no es un double", ex);
649 652
                     }

Also available in: Unified diff