View | Details | Raw Unified | Return to bug 224387 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/gmf/runtime/diagram/ui/printing/render/util/PrintHelper.java (+9 lines)
Lines 49-54 Link Here
49
49
50
		options.setCopies(1);
50
		options.setCopies(1);
51
		options.setCollate(false);
51
		options.setCollate(false);
52
		
53
		options.setQualityHigh(true);
54
		options.setSideOneSided(true);
55
		options.setChromaticityColor(true);
56
				
52
	}
57
	}
53
58
54
	/*
59
	/*
Lines 134-138 Link Here
134
		// TODO Not supported by the JPS dialog
139
		// TODO Not supported by the JPS dialog
135
		return false;
140
		return false;
136
	}
141
	}
142
	
143
	public PrintOptions getPrintOptions(){
144
		return options;
145
	}
137
146
138
}
147
}
(-)src/org/eclipse/gmf/runtime/diagram/ui/printing/render/model/PrintOptions.java (+127 lines)
Lines 33-38 Link Here
33
    
33
    
34
    public static String PROPERTY_COPIES = "copies"; //$NON-NLS-1$
34
    public static String PROPERTY_COPIES = "copies"; //$NON-NLS-1$
35
    public static String PROPERTY_COLLATE = "collate"; //$NON-NLS-1$
35
    public static String PROPERTY_COLLATE = "collate"; //$NON-NLS-1$
36
        
37
    public static String PROPERTY_QUALITY_HIGH = "qualityHigh"; //$NON-NLS-1$
38
    public static String PROPERTY_QUALITY_LOW = "qualityLow"; //$NON-NLS-1$
39
    public static String PROPERTY_QUALITY_MED = "qualityMed"; //$NON-NLS-1$
40
    public static String PROPERTY_CHROMATICITY_MONO = "chromaticityMono"; //$NON-NLS-1$
41
    public static String PROPERTY_CHROMATICITY_COLOR = "chromaticityColor"; //$NON-NLS-1$
42
    public static String PROPERTY_SIDES_ONESIDED = "sideOneSided"; //$NON-NLS-1$
43
    public static String PROPERTY_SIDES_TUMBLE = "sideTumble"; //$NON-NLS-1$
44
    public static String PROPERTY_SIDES_DUPLEX = "sideDuplex"; //$NON-NLS-1$
45
 
46
    public static String PROPERTY_JOB_NAME = "jobName"; //$NON-NLS-1$
47
    public static String PROPERTY_USER_NAME = "userName"; //$NON-NLS-1$
36
48
37
    private PrintDestination destination;
49
    private PrintDestination destination;
38
    
50
    
Lines 48-53 Link Here
48
    private int copies;
60
    private int copies;
49
    private boolean collate;
61
    private boolean collate;
50
    
62
    
63
    private boolean qualityHigh;
64
    private boolean qualityLow;
65
    private boolean qualityMed;
66
        
67
    private boolean chromaticityColor;
68
    private boolean chromaticityMono;
69
    
70
    private boolean sideOneSided;
71
    private boolean sideTumble;
72
    private boolean sideDuplex;
73
   
74
    private String jobName;
75
    private String userName;
76
    
51
    public PrintOptions() {
77
    public PrintOptions() {
52
        super();
78
        super();
53
    }
79
    }
Lines 71-76 Link Here
71
        this.percentScaling = percentScaling;
97
        this.percentScaling = percentScaling;
72
        firePropertyChange(PROPERTY_PERCENT_SCALING, oldScaling, percentScaling);
98
        firePropertyChange(PROPERTY_PERCENT_SCALING, oldScaling, percentScaling);
73
    }
99
    }
100
    public String getJobName() {
101
        return jobName;
102
    }
103
    
104
    public void setJobName(String name) {
105
        String oldName = this.jobName;
106
        this.jobName = name;
107
        firePropertyChange(PROPERTY_JOB_NAME, oldName, name);
108
    }
109
    
110
    public String getUserName() {
111
        return userName;
112
    }
113
    
114
    public void setUserName(String name) {
115
        String oldName = this.userName;
116
        this.userName = name;
117
        firePropertyChange(PROPERTY_USER_NAME, oldName, name);
118
    }
119
    
120
    public boolean isQualityHigh() {
121
        return this.qualityHigh;
122
    }
123
    
124
    public void setQualityHigh(boolean qualityHigh) {
125
        boolean oldQualityHigh = this.qualityHigh;
126
        this.qualityHigh = qualityHigh;
127
        firePropertyChange(PROPERTY_QUALITY_HIGH, oldQualityHigh, qualityHigh);
128
    }
129
    
130
    public boolean isQualityLow() {
131
        return this.qualityLow;
132
    }
133
    
134
    public void setQualityLow(boolean qualityLow) {
135
        boolean oldQualityLow = this.qualityLow;
136
        this.qualityLow = qualityLow;
137
        firePropertyChange(PROPERTY_QUALITY_LOW, oldQualityLow, this.qualityLow);
138
    }
139
    
140
    public boolean isQualityMed() {
141
        return this.qualityMed;
142
    }
143
    
144
    public void setQualityMed(boolean qualityMed) {
145
        boolean oldQualityMed = this.qualityMed;
146
        this.qualityMed = qualityMed;
147
        firePropertyChange(PROPERTY_QUALITY_MED, oldQualityMed, this.qualityMed);
148
    }
149
    
74
    
150
    
75
    public int getScaleFactor() {
151
    public int getScaleFactor() {
76
        return scaleFactor;
152
        return scaleFactor;
Lines 151-154 Link Here
151
        this.collate = collate;
227
        this.collate = collate;
152
        firePropertyChange(PROPERTY_COLLATE, oldCollate, collate);
228
        firePropertyChange(PROPERTY_COLLATE, oldCollate, collate);
153
    }
229
    }
230
    
231
    
232
    public boolean isChromaticityColor() {
233
        return this.chromaticityColor;
234
    }
235
    
236
    public void setChromaticityColor(boolean chromaticityColor) {
237
        boolean oldChromaticityColor = this.chromaticityColor;
238
        this.chromaticityColor = chromaticityColor;
239
        firePropertyChange(PROPERTY_CHROMATICITY_COLOR, oldChromaticityColor, this.chromaticityColor);
240
    }
241
    
242
    public boolean isChromaticityMono() {
243
        return this.chromaticityMono;
244
    }
245
    
246
    public void setChromaticityMono(boolean chromaticityMono) {
247
        boolean oldChromaticityMono = this.chromaticityMono;
248
        this.chromaticityMono = chromaticityMono;
249
        firePropertyChange(PROPERTY_CHROMATICITY_MONO, oldChromaticityMono, this.chromaticityMono);
250
    }
251
    
252
    public boolean isSideOneSided() {
253
        return this.sideOneSided;
254
    }
255
    
256
    public void setSideOneSided(boolean sideOneSided) {
257
        boolean oldSideOneSided = this.sideOneSided;
258
        this.sideOneSided = sideOneSided;
259
        firePropertyChange(PROPERTY_SIDES_ONESIDED, oldSideOneSided, this.sideOneSided);
260
    }
261
    
262
    public boolean isSideTumble() {
263
        return this.sideTumble;
264
    }
265
    
266
    public void setSideTumble(boolean sideTumble) {
267
        boolean oldSideTumble = this.sideTumble;
268
        this.sideTumble = sideTumble;
269
        firePropertyChange(PROPERTY_SIDES_TUMBLE, oldSideTumble, this.sideTumble);
270
    }
271
    
272
    public boolean isSideDuplex() {
273
        return this.sideDuplex;
274
    }
275
    
276
    public void setSideDuplex(boolean sideDuplex) {
277
        boolean oldSideDuplex = this.sideDuplex;
278
        this.sideDuplex = sideDuplex;
279
        firePropertyChange(PROPERTY_SIDES_DUPLEX, oldSideDuplex, this.sideDuplex);
280
    }
154
}
281
}
(-)src/org/eclipse/gmf/runtime/diagram/ui/printing/render/internal/JPSDiagramPrinter.java (-22 / +76 lines)
Lines 11-16 Link Here
11
11
12
package org.eclipse.gmf.runtime.diagram.ui.printing.render.internal;
12
package org.eclipse.gmf.runtime.diagram.ui.printing.render.internal;
13
13
14
import java.awt.BasicStroke;
14
import java.awt.print.PageFormat;
15
import java.awt.print.PageFormat;
15
import java.awt.print.PrinterException;
16
import java.awt.print.PrinterException;
16
import java.util.Iterator;
17
import java.util.Iterator;
Lines 29-34 Link Here
29
import javax.print.attribute.HashPrintRequestAttributeSet;
30
import javax.print.attribute.HashPrintRequestAttributeSet;
30
import javax.print.attribute.HashPrintServiceAttributeSet;
31
import javax.print.attribute.HashPrintServiceAttributeSet;
31
import javax.print.attribute.PrintRequestAttributeSet;
32
import javax.print.attribute.PrintRequestAttributeSet;
33
import javax.print.attribute.standard.Chromaticity;
32
import javax.print.attribute.standard.Copies;
34
import javax.print.attribute.standard.Copies;
33
import javax.print.attribute.standard.JobName;
35
import javax.print.attribute.standard.JobName;
34
import javax.print.attribute.standard.Media;
36
import javax.print.attribute.standard.Media;
Lines 36-43 Link Here
36
import javax.print.attribute.standard.MediaSize;
38
import javax.print.attribute.standard.MediaSize;
37
import javax.print.attribute.standard.MediaSizeName;
39
import javax.print.attribute.standard.MediaSizeName;
38
import javax.print.attribute.standard.OrientationRequested;
40
import javax.print.attribute.standard.OrientationRequested;
41
import javax.print.attribute.standard.PrintQuality;
39
import javax.print.attribute.standard.PrinterName;
42
import javax.print.attribute.standard.PrinterName;
40
import javax.print.attribute.standard.SheetCollate;
43
import javax.print.attribute.standard.SheetCollate;
44
import javax.print.attribute.standard.Sides;
41
45
42
import org.eclipse.draw2d.Graphics;
46
import org.eclipse.draw2d.Graphics;
43
import org.eclipse.draw2d.geometry.Rectangle;
47
import org.eclipse.draw2d.geometry.Rectangle;
Lines 62-75 Link Here
62
import org.eclipse.gmf.runtime.diagram.ui.printing.internal.l10n.DiagramUIPrintingMessages;
66
import org.eclipse.gmf.runtime.diagram.ui.printing.internal.l10n.DiagramUIPrintingMessages;
63
import org.eclipse.gmf.runtime.diagram.ui.printing.internal.util.DiagramPrinter;
67
import org.eclipse.gmf.runtime.diagram.ui.printing.internal.util.DiagramPrinter;
64
import org.eclipse.gmf.runtime.diagram.ui.printing.internal.util.PrintHelperUtil;
68
import org.eclipse.gmf.runtime.diagram.ui.printing.internal.util.PrintHelperUtil;
69
import org.eclipse.gmf.runtime.diagram.ui.printing.render.model.PrintOptions;
70
import org.eclipse.gmf.runtime.diagram.ui.printing.render.util.PrintHelper;
65
import org.eclipse.gmf.runtime.diagram.ui.printing.util.DiagramPrinterUtil;
71
import org.eclipse.gmf.runtime.diagram.ui.printing.util.DiagramPrinterUtil;
66
import org.eclipse.gmf.runtime.diagram.ui.util.DiagramEditorUtil;
72
import org.eclipse.gmf.runtime.diagram.ui.util.DiagramEditorUtil;
67
import org.eclipse.gmf.runtime.draw2d.ui.internal.graphics.MapModeGraphics;
73
import org.eclipse.gmf.runtime.draw2d.ui.internal.graphics.MapModeGraphics;
74
import org.eclipse.gmf.runtime.draw2d.ui.internal.graphics.ScaledGraphics;
68
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
75
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
69
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
76
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
70
import org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.graphics.GraphicsToGraphics2DAdaptor;
77
import org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.graphics.GraphicsToGraphics2DAdaptor;
71
import org.eclipse.gmf.runtime.draw2d.ui.render.internal.graphics.RenderedMapModeGraphics;
78
import org.eclipse.gmf.runtime.draw2d.ui.render.internal.graphics.RenderedMapModeGraphics;
72
import org.eclipse.gmf.runtime.draw2d.ui.render.internal.graphics.RenderedScaledGraphics;
73
import org.eclipse.gmf.runtime.notation.Diagram;
79
import org.eclipse.gmf.runtime.notation.Diagram;
74
import org.eclipse.jface.dialogs.MessageDialog;
80
import org.eclipse.jface.dialogs.MessageDialog;
75
import org.eclipse.jface.preference.IPreferenceStore;
81
import org.eclipse.jface.preference.IPreferenceStore;
Lines 90-102 Link Here
90
 */
96
 */
91
public class JPSDiagramPrinter extends DiagramPrinter implements
97
public class JPSDiagramPrinter extends DiagramPrinter implements
92
		java.awt.print.Printable {
98
		java.awt.print.Printable {
93
99
	
94
100
	// A constant that takes into account screen display DPI and the graphic DPI
101
	// 72.0 DPI is an AWT constant @see java.awt.Graphics2D
102
	private static double AWT_DPI_CONST = 72.0;
103
	
104
	// The print service used during printing.
95
	private PrintService printService;
105
	private PrintService printService;
106
	
107
	// Page information that is collected up front and used during the async printing calls.
96
	private PageData[] pages;
108
	private PageData[] pages;
109
	
110
	// The print helper contains page information.
97
	private IPrintHelper printHelper;
111
	private IPrintHelper printHelper;
98
	
112
	
99
100
	public JPSDiagramPrinter(PreferencesHint preferencesHint, IMapMode mm) {
113
	public JPSDiagramPrinter(PreferencesHint preferencesHint, IMapMode mm) {
101
		super(preferencesHint, mm);
114
		super(preferencesHint, mm);
102
		this.preferencesHint = preferencesHint;
115
		this.preferencesHint = preferencesHint;
Lines 347-369 Link Here
347
			return java.awt.print.Printable.NO_SUCH_PAGE;
360
			return java.awt.print.Printable.NO_SUCH_PAGE;
348
		}
361
		}
349
362
350
		try {			
363
		try {
351
			swtGraphics = new GraphicsToGraphics2DAdaptor(
364
			swtGraphics = new GraphicsToGraphics2DAdaptor(
352
					(java.awt.Graphics2D) printGraphics, new Rectangle(0, 0,
365
					(java.awt.Graphics2D) printGraphics, new Rectangle(0, 0,
353
							(int) pageFormat.getWidth(), (int) pageFormat
366
							(int) pageFormat.getWidth(), (int) pageFormat
354
									.getHeight()));
367
									.getHeight())) {
368
				/*
369
				 * (non-Javadoc)
370
				 * @see org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.graphics.GraphicsToGraphics2DAdaptor#setLineWidth(int)
371
				 */
372
				public void setLineWidth(int width) {
373
					super.setLineWidth(width);
374
375
					BasicStroke scaledStroke = getStroke();
376
					//
377
					// Make a special case for line thickness to take the printer
378
					// resolution into account.
379
					//
380
					scaledStroke = new BasicStroke(
381
							(float) (width * AWT_DPI_CONST / 100), 
382
							scaledStroke.getEndCap(),
383
							scaledStroke.getLineJoin(), 
384
							scaledStroke.getMiterLimit(), 
385
							scaledStroke.getDashArray(), 0);
355
386
387
					getGraphics2D().setStroke(scaledStroke);
388
				}
389
			};
390
			
356
			graphics = createMapModeGraphics(createPrinterGraphics(swtGraphics));
391
			graphics = createMapModeGraphics(createPrinterGraphics(swtGraphics));
357
			//
392
			graphics.scale(AWT_DPI_CONST / display_dpi.x);
358
			// Take into account screen display DPI and the graphic DPI
359
			// 72.0 DPI is an AWT constant @see java.awt.Graphics2D
360
			//
361
			graphics.scale(72.0 / display_dpi.x);
362
363
			drawPage(pages[pageIndex]);
393
			drawPage(pages[pageIndex]);
364
		} catch (Exception e) {
394
			
365
			System.out.println(e);
395
		}  finally {
366
		} finally {
367
			dispose();
396
			dispose();
368
		}
397
		}
369
398
Lines 378-389 Link Here
378
		return new RenderedMapModeGraphics(theGraphics, getMapMode());
407
		return new RenderedMapModeGraphics(theGraphics, getMapMode());
379
	}
408
	}
380
409
381
	
410
	protected ScaledGraphics createPrinterGraphics(Graphics theGraphics) {
382
	protected RenderedScaledGraphics createPrinterGraphics(Graphics theGraphics) {
411
		return new ScaledGraphics(theGraphics);
383
		return new RenderedScaledGraphics(theGraphics);
384
	}
412
	}
385
	
413
		
386
	
387
	/**
414
	/**
388
	 * Set printing options in a format that is suitable for the Java print
415
	 * Set printing options in a format that is suitable for the Java print
389
	 * service
416
	 * service
Lines 398-403 Link Here
398
			String jobName,
425
			String jobName,
399
			IPreferenceStore fPreferences) {
426
			IPreferenceStore fPreferences) {
400
427
428
		PrintOptions advancedOptions = ((PrintHelper) (printHelper)).getPrintOptions();
429
401
		PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet();
430
		PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet();
402
431
403
		if (fPreferences
432
		if (fPreferences
Lines 428-441 Link Here
428
			printRequestAttributeSet.add(MediaSizeName.ISO_B5);
457
			printRequestAttributeSet.add(MediaSizeName.ISO_B5);
429
		}
458
		}
430
459
460
		if (advancedOptions.isQualityLow()) {
461
			printRequestAttributeSet.add(PrintQuality.DRAFT);
462
		} else if (advancedOptions.isQualityMed()) {
463
			printRequestAttributeSet.add(PrintQuality.NORMAL);
464
		} else if (advancedOptions.isQualityHigh()) {
465
			printRequestAttributeSet.add(PrintQuality.HIGH);
466
		}
467
		if (advancedOptions.isSideDuplex()) {
468
			printRequestAttributeSet.add(Sides.DUPLEX);
469
		} else if (advancedOptions.isSideOneSided()) {
470
			printRequestAttributeSet.add(Sides.ONE_SIDED);
471
		} else if (advancedOptions.isSideTumble()) {
472
			printRequestAttributeSet.add(Sides.TUMBLE);
473
		}
474
475
		if (advancedOptions.isChromaticityColor()) {
476
			printRequestAttributeSet.add(Chromaticity.COLOR);
477
		} else {
478
			printRequestAttributeSet.add(Chromaticity.MONOCHROME);
479
		}
480
431
		MediaSizeName media = (MediaSizeName) printRequestAttributeSet
481
		MediaSizeName media = (MediaSizeName) printRequestAttributeSet
432
				.get(Media.class);
482
				.get(Media.class);
433
		MediaSize mediaSize = MediaSize.getMediaSizeForName(media);
483
		MediaSize mediaSize = MediaSize.getMediaSizeForName(media);
434
		
484
435
		printRequestAttributeSet.add(new MediaPrintableArea((float) 0.0,
485
		printRequestAttributeSet.add(new MediaPrintableArea((float) 0.0,
436
				(float) 0.0, (mediaSize.getX(MediaSize.INCH)), (mediaSize
486
				(float) 0.0, (mediaSize.getX(MediaSize.INCH)), (mediaSize
437
						.getY(MediaSize.INCH)), MediaPrintableArea.INCH));
487
						.getY(MediaSize.INCH)), MediaPrintableArea.INCH));
438
		
488
439
		printRequestAttributeSet.add(new Copies(printHelper
489
		printRequestAttributeSet.add(new Copies(printHelper
440
				.getDlgNumberOfCopies()));
490
				.getDlgNumberOfCopies()));
441
491
Lines 445-450 Link Here
445
			printRequestAttributeSet.add(SheetCollate.UNCOLLATED);
495
			printRequestAttributeSet.add(SheetCollate.UNCOLLATED);
446
		}
496
		}
447
497
498
		String userJobName = advancedOptions.getJobName();
499
		if (userJobName != null && userJobName.length() > 0) {
500
			jobName = userJobName;
501
		}
448
		printRequestAttributeSet.add(new JobName(jobName, Locale.getDefault()));
502
		printRequestAttributeSet.add(new JobName(jobName, Locale.getDefault()));
449
503
450
		return printRequestAttributeSet;
504
		return printRequestAttributeSet;
(-)src/org/eclipse/gmf/runtime/diagram/ui/printing/render/dialogs/JPSPrintDialog.java (-11 / +15 lines)
Lines 45-60 Link Here
45
    private CopiesBlock copiesBlock;
45
    private CopiesBlock copiesBlock;
46
    private ActionsBlock actionsBlock;
46
    private ActionsBlock actionsBlock;
47
    
47
    
48
    private final DialogBlock.IDialogUnitConverter dluConverter =
48
    private final DialogBlock.IDialogUnitConverter dluConverter = new DialogBlock.IDialogUnitConverter() {
49
        new DialogBlock.IDialogUnitConverter() {
49
50
        
50
		public int convertHorizontalDLUsToPixels(int dlus) {
51
        public int convertHorizontalDLUsToPixels(int dlus) {
51
			return JPSPrintDialog.this.convertHorizontalDLUsToPixels(dlus);
52
            return JPSPrintDialog.this.convertHorizontalDLUsToPixels(dlus);
52
		}
53
        }
53
54
        
54
		public Shell getShell() {
55
        public Shell getShell() {
55
			return JPSPrintDialog.this.getShell();
56
            return JPSPrintDialog.this.getShell();
56
		}
57
        }};
57
	};
58
    
58
    
59
    public JPSPrintDialog(IShellProvider parentShell, PrintOptions options) {
59
    public JPSPrintDialog(IShellProvider parentShell, PrintOptions options) {
60
        super(parentShell);
60
        super(parentShell);
Lines 66-71 Link Here
66
        this.options = options;
66
        this.options = options;
67
    }
67
    }
68
68
69
    /*
70
     * (non-Javadoc)
71
     * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
72
     */
69
    protected void configureShell(Shell newShell) {
73
    protected void configureShell(Shell newShell) {
70
        super.configureShell(newShell);
74
        super.configureShell(newShell);
71
        
75
        
Lines 119-125 Link Here
119
	}
123
	}
120
    
124
    
121
    protected void createExtensibleBlockArea(Composite result) {
125
    protected void createExtensibleBlockArea(Composite result) {
122
    	  // meant to be overiden by subclasses to add additional blocks.
126
    	  // meant to be overridden by subclasses to add additional blocks.
123
  	}
127
  	}
124
    
128
    
125
        
129
        
(-)src/org/eclipse/gmf/runtime/diagram/ui/printing/render/dialogs/PrinterBlock.java (-11 / +19 lines)
Lines 35-41 Link Here
35
import org.eclipse.gmf.runtime.diagram.ui.printing.render.model.PrintOptions;
35
import org.eclipse.gmf.runtime.diagram.ui.printing.render.model.PrintOptions;
36
import org.eclipse.jface.databinding.viewers.ViewersObservables;
36
import org.eclipse.jface.databinding.viewers.ViewersObservables;
37
import org.eclipse.jface.viewers.ComboViewer;
37
import org.eclipse.jface.viewers.ComboViewer;
38
import org.eclipse.jface.viewers.ISelectionChangedListener;
39
import org.eclipse.jface.viewers.IStructuredContentProvider;
38
import org.eclipse.jface.viewers.IStructuredContentProvider;
40
import org.eclipse.jface.viewers.LabelProvider;
39
import org.eclipse.jface.viewers.LabelProvider;
41
import org.eclipse.jface.viewers.SelectionChangedEvent;
40
import org.eclipse.jface.viewers.SelectionChangedEvent;
Lines 47-52 Link Here
47
import org.eclipse.swt.widgets.Composite;
46
import org.eclipse.swt.widgets.Composite;
48
import org.eclipse.swt.widgets.Control;
47
import org.eclipse.swt.widgets.Control;
49
import org.eclipse.swt.widgets.Label;
48
import org.eclipse.swt.widgets.Label;
49
import org.eclipse.ui.PlatformUI;
50
50
51
/**
51
/**
52
 * A section of the JPS print dialog that adds printer options.
52
 * A section of the JPS print dialog that adds printer options.
Lines 96-119 Link Here
96
		// until a workaround can be discovered.
96
		// until a workaround can be discovered.
97
		//
97
		//
98
		
98
		
99
		// combo.addSelectionChangedListener(new ISelectionChangedListener() {
99
		//		 combo.addSelectionChangedListener(new ISelectionChangedListener() {
100
		//
100
		//		
101
		// public void selectionChanged(SelectionChangedEvent event) {
101
		//		 public void selectionChanged(SelectionChangedEvent event) {
102
		// if (event != null) {
102
		//				if (event != null) {
103
		// handlePrinterSelectionChanged(event);
103
		//					handlePrinterSelectionChanged(event);
104
		// }
104
		//				}
105
		// }
105
		//			}
106
		//		});
106
		//		});
107
107
108
		layoutFillHorizontal(combo.getControl());
108
		layoutFillHorizontal(combo.getControl());
109
109
110
		Button propertiesButton = button(result,
110
		Button propertiesButton = button(result,
111
				DiagramUIPrintingMessages.JPSPrintDialog_Properties);
111
				DiagramUIPrintingMessages.JPSPrintDialog_Properties);
112
		propertiesButton.setEnabled(false);
112
		propertiesButton.setEnabled(true);
113
113
114
		propertiesButton.addSelectionListener(new SelectionAdapter() {
114
		propertiesButton.addSelectionListener(new SelectionAdapter() {
115
			public void widgetSelected(SelectionEvent e) {
115
			public void widgetSelected(SelectionEvent e) {
116
				// TODO: Introduce new dialog in phase 2
116
				 openPrintOptionsDialog();
117
			}
117
			}
118
		});
118
		});
119
119
Lines 188-194 Link Here
188
188
189
				PrintServiceAttributeSet printServiceAttributes = printService
189
				PrintServiceAttributeSet printServiceAttributes = printService
190
						.getAttributes();
190
						.getAttributes();
191
191
				
192
				PrinterState printerState = (PrinterState) printServiceAttributes
192
				PrinterState printerState = (PrinterState) printServiceAttributes
193
						.get(PrinterState.class);
193
						.get(PrinterState.class);
194
194
Lines 290-293 Link Here
290
			return ((PrintDestination) element).getName();
290
			return ((PrintDestination) element).getName();
291
		}
291
		}
292
	}
292
	}
293
		
294
	private void openPrintOptionsDialog() {
295
296
		JPSOptionsDialog dlg = new JPSOptionsDialog(PlatformUI.getWorkbench()
297
				.getActiveWorkbenchWindow().getShell(), bindings, options);
298
		dlg.open();
299
300
	}
293
}
301
}
(-)src/org/eclipse/gmf/runtime/diagram/ui/printing/render/dialogs/SidesBlock.java (+80 lines)
Added Link Here
1
/******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    IBM Corporation - initial API and implementation 
10
 ****************************************************************************/
11
12
package org.eclipse.gmf.runtime.diagram.ui.printing.render.dialogs;
13
14
import org.eclipse.core.databinding.DataBindingContext;
15
import org.eclipse.core.databinding.beans.BeansObservables;
16
import org.eclipse.core.databinding.observable.Realm;
17
import org.eclipse.gmf.runtime.diagram.ui.printing.internal.l10n.DiagramUIPrintingMessages;
18
import org.eclipse.gmf.runtime.diagram.ui.printing.render.model.PrintOptions;
19
import org.eclipse.jface.databinding.swt.SWTObservables;
20
import org.eclipse.swt.widgets.Button;
21
import org.eclipse.swt.widgets.Composite;
22
import org.eclipse.swt.widgets.Control;
23
24
/**
25
 * A section of the options print dialog that handles the duplex/single sided printing.
26
 * 
27
 * @author James Bruck (jbruck)
28
 */
29
public class SidesBlock extends DialogBlock {
30
31
	private final DataBindingContext bindings;
32
	private final PrintOptions options;
33
34
	SidesBlock(IDialogUnitConverter dluConverter, DataBindingContext bindings,
35
			PrintOptions options) {
36
		super(dluConverter);
37
38
		this.bindings = bindings;
39
		this.options = options;
40
	}
41
42
	/*
43
	 * (non-Javadoc)
44
	 * @see org.eclipse.gmf.runtime.common.ui.printing.internal.dialogs.DialogBlock#createContents(org.eclipse.swt.widgets.Composite)
45
	 */
46
	public Control createContents(Composite parent) {
47
		final Realm realm = bindings.getValidationRealm();
48
49
		Composite result = group(parent,
50
				DiagramUIPrintingMessages.JPSOptionsDialog_Sides);
51
		layout(result, 2);
52
53
		Button oneSideRadio = radio(result,
54
				DiagramUIPrintingMessages.JPSOptionsDialog_SidesOneSided);
55
		layoutSpanHorizontal(oneSideRadio, 4);
56
57
		Button tumbleRadio = radio(result,
58
				DiagramUIPrintingMessages.JPSOptionsDialog_SidesTumble);
59
		layoutSpanHorizontal(tumbleRadio, 4);
60
61
		Button duplexRadio = radio(result,
62
				DiagramUIPrintingMessages.JPSOptionsDialog_SidesDuplex);
63
		layoutSpanHorizontal(duplexRadio, 4);
64
65
		bindings.bindValue(SWTObservables.observeSelection(oneSideRadio),
66
				BeansObservables.observeValue(realm, options,
67
						PrintOptions.PROPERTY_SIDES_ONESIDED), null, null);
68
69
		bindings.bindValue(SWTObservables.observeSelection(tumbleRadio),
70
				BeansObservables.observeValue(realm, options,
71
						PrintOptions.PROPERTY_SIDES_TUMBLE), null, null);
72
73
		bindings.bindValue(SWTObservables.observeSelection(duplexRadio),
74
				BeansObservables.observeValue(realm, options,
75
						PrintOptions.PROPERTY_SIDES_DUPLEX), null, null);
76
77
		return result;
78
	}
79
80
}
(-)src/org/eclipse/gmf/runtime/diagram/ui/printing/render/dialogs/JobAttributesBlock.java (+64 lines)
Added Link Here
1
/******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    IBM Corporation - initial API and implementation 
10
 ****************************************************************************/
11
12
package org.eclipse.gmf.runtime.diagram.ui.printing.render.dialogs;
13
14
import org.eclipse.core.databinding.DataBindingContext;
15
import org.eclipse.core.databinding.beans.BeansObservables;
16
import org.eclipse.core.databinding.observable.Realm;
17
import org.eclipse.gmf.runtime.diagram.ui.printing.internal.l10n.DiagramUIPrintingMessages;
18
import org.eclipse.gmf.runtime.diagram.ui.printing.render.model.PrintOptions;
19
import org.eclipse.jface.databinding.swt.SWTObservables;
20
import org.eclipse.swt.SWT;
21
import org.eclipse.swt.widgets.Composite;
22
import org.eclipse.swt.widgets.Control;
23
import org.eclipse.swt.widgets.Text;
24
25
/**
26
 * A section of the options print dialog that handles the job attributes.
27
 * 
28
 * @author James Bruck (jbruck)
29
 */
30
public class JobAttributesBlock extends DialogBlock {
31
	private final DataBindingContext bindings;
32
	private final PrintOptions options;
33
34
	JobAttributesBlock(IDialogUnitConverter dluConverter,
35
			DataBindingContext bindings, PrintOptions options) {
36
		super(dluConverter);
37
38
		this.bindings = bindings;
39
		this.options = options;
40
	}
41
42
	/*
43
	 * (non-Javadoc)
44
	 * 
45
	 * @see org.eclipse.gmf.runtime.common.ui.printing.internal.dialogs.DialogBlock#createContents(org.eclipse.swt.widgets.Composite)
46
	 */
47
	public Control createContents(Composite parent) {
48
		final Realm realm = bindings.getValidationRealm();
49
50
		Composite result = group(parent,
51
				DiagramUIPrintingMessages.JPSOptionsDialog_JobAttributes);
52
		layout(result, 2);
53
54
		layoutHorizontalIndent(layoutAlignRight(label(result,
55
				DiagramUIPrintingMessages.JPSOptionsDialog_JobName)));
56
		Text jobName = text(result, 80);
57
58
		bindings.bindValue(SWTObservables.observeText(jobName, SWT.Modify),
59
				BeansObservables.observeValue(realm, options,
60
						PrintOptions.PROPERTY_JOB_NAME), null, null);
61
62
		return result;
63
	}
64
}
(-)src/org/eclipse/gmf/runtime/diagram/ui/printing/render/dialogs/QualityBlock.java (+80 lines)
Added Link Here
1
/******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    IBM Corporation - initial API and implementation 
10
 ****************************************************************************/
11
12
package org.eclipse.gmf.runtime.diagram.ui.printing.render.dialogs;
13
14
import org.eclipse.core.databinding.DataBindingContext;
15
import org.eclipse.core.databinding.beans.BeansObservables;
16
import org.eclipse.core.databinding.observable.Realm;
17
import org.eclipse.gmf.runtime.diagram.ui.printing.internal.l10n.DiagramUIPrintingMessages;
18
import org.eclipse.gmf.runtime.diagram.ui.printing.render.model.PrintOptions;
19
import org.eclipse.jface.databinding.swt.SWTObservables;
20
import org.eclipse.swt.widgets.Button;
21
import org.eclipse.swt.widgets.Composite;
22
import org.eclipse.swt.widgets.Control;
23
24
/**
25
 * A section of the options print dialog that handles the print quality.
26
 * 
27
 * @author James Bruck (jbruck)
28
 */
29
public class QualityBlock extends DialogBlock {
30
31
	private final DataBindingContext bindings;
32
	private final PrintOptions options;
33
34
	QualityBlock(IDialogUnitConverter dluConverter,
35
			DataBindingContext bindings, PrintOptions options) {
36
		super(dluConverter);
37
38
		this.bindings = bindings;
39
		this.options = options;
40
	}
41
42
	/*
43
	 * (non-Javadoc)
44
	 * 
45
	 * @see org.eclipse.gmf.runtime.common.ui.printing.internal.dialogs.DialogBlock#createContents(org.eclipse.swt.widgets.Composite)
46
	 */
47
	public Control createContents(Composite parent) {
48
		final Realm realm = bindings.getValidationRealm();
49
50
		Composite result = group(parent,
51
				DiagramUIPrintingMessages.JPSOptionsDialog_Quality);
52
		layout(result, 2);
53
54
		Button highRadio = radio(result,
55
				DiagramUIPrintingMessages.JPSOptionsDialog_QualityHigh);
56
		layoutSpanHorizontal(highRadio, 4);
57
58
		Button mediumRadio = radio(result,
59
				DiagramUIPrintingMessages.JPSOptionsDialog_QualityMedium);
60
		layoutSpanHorizontal(mediumRadio, 4);
61
62
		Button lowRadio = radio(result,
63
				DiagramUIPrintingMessages.JPSOptionsDialog_QualityLow);
64
		layoutSpanHorizontal(lowRadio, 4);
65
66
		bindings.bindValue(SWTObservables.observeSelection(highRadio),
67
				BeansObservables.observeValue(realm, options,
68
						PrintOptions.PROPERTY_QUALITY_HIGH), null, null);
69
70
		bindings.bindValue(SWTObservables.observeSelection(mediumRadio),
71
				BeansObservables.observeValue(realm, options,
72
						PrintOptions.PROPERTY_QUALITY_MED), null, null);
73
74
		bindings.bindValue(SWTObservables.observeSelection(lowRadio),
75
				BeansObservables.observeValue(realm, options,
76
						PrintOptions.PROPERTY_QUALITY_LOW), null, null);
77
78
		return result;
79
	}
80
}
(-)src/org/eclipse/gmf/runtime/diagram/ui/printing/render/dialogs/JPSOptionsDialog.java (+114 lines)
Added Link Here
1
/******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    IBM Corporation - initial API and implementation 
10
 ****************************************************************************/
11
12
package org.eclipse.gmf.runtime.diagram.ui.printing.render.dialogs;
13
14
import org.eclipse.core.databinding.DataBindingContext;
15
import org.eclipse.gmf.runtime.diagram.ui.printing.internal.l10n.DiagramUIPrintingMessages;
16
import org.eclipse.gmf.runtime.diagram.ui.printing.render.model.PrintOptions;
17
import org.eclipse.jface.dialogs.TrayDialog;
18
import org.eclipse.jface.window.IShellProvider;
19
import org.eclipse.swt.SWT;
20
import org.eclipse.swt.widgets.Composite;
21
import org.eclipse.swt.widgets.Control;
22
import org.eclipse.swt.widgets.Shell;
23
24
/**
25
 * A dialog that presents advanced printer options to the user.
26
 * 
27
 * @author James Bruck (jbruck)
28
 */
29
public class JPSOptionsDialog extends TrayDialog {
30
31
	private DataBindingContext bindings;
32
	public final PrintOptions options;
33
34
	private QualityBlock qualityBlock;
35
	private ColorBlock colorBlock;
36
	private SidesBlock sidesBlock;
37
	private JobAttributesBlock jobAttributesBlock;
38
39
	private final DialogBlock.IDialogUnitConverter dluConverter = new DialogBlock.IDialogUnitConverter() {
40
41
		public int convertHorizontalDLUsToPixels(int dlus) {
42
			return JPSOptionsDialog.this.convertHorizontalDLUsToPixels(dlus);
43
		}
44
45
		public Shell getShell() {
46
			return JPSOptionsDialog.this.getShell();
47
		}
48
	};
49
50
	protected JPSOptionsDialog(Shell shell, DataBindingContext bindings,
51
			PrintOptions options) {
52
		super(shell);
53
		this.options = options;
54
		this.bindings = bindings;
55
	}
56
57
	public JPSOptionsDialog(IShellProvider parentShell,
58
			DataBindingContext bindings, PrintOptions options) {
59
		super(parentShell);
60
		this.options = options;
61
		this.bindings = bindings;
62
	}
63
64
	/*
65
	 * (non-Javadoc)
66
	 * 
67
	 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
68
	 */
69
	protected void configureShell(Shell newShell) {
70
		
71
		super.configureShell(newShell);
72
		newShell
73
				.setText(DiagramUIPrintingMessages.JPSOptionsDialog_AdvancedOptions);
74
	}
75
76
	/*
77
	 * (non-Javadoc)
78
	 * 
79
	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
80
	 */
81
	protected Control createDialogArea(Composite parent) {
82
83
		Composite result = new Composite(parent, SWT.NONE);
84
		DialogBlock.layout(result, 2);
85
86
		createColorBlockArea(result);
87
		createQualityBlockArea(result);
88
		createSidesBlockArea(result);
89
		createJobAttributesBlockArea(result);
90
91
		return result;
92
	}
93
94
	protected void createQualityBlockArea(Composite result) {
95
		qualityBlock = new QualityBlock(dluConverter, bindings, options);
96
		qualityBlock.createContents(result);
97
	}
98
99
	protected void createColorBlockArea(Composite result) {
100
		colorBlock = new ColorBlock(dluConverter, bindings, options);
101
		colorBlock.createContents(result);
102
	}
103
104
	protected void createSidesBlockArea(Composite result) {
105
		sidesBlock = new SidesBlock(dluConverter, bindings, options);
106
		sidesBlock.createContents(result);
107
	}
108
109
	protected void createJobAttributesBlockArea(Composite result) {
110
		jobAttributesBlock = new JobAttributesBlock(dluConverter, bindings,
111
				options);
112
		jobAttributesBlock.createContents(result);
113
	}
114
}
(-)src/org/eclipse/gmf/runtime/diagram/ui/printing/render/dialogs/ColorBlock.java (+123 lines)
Added Link Here
1
/******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    IBM Corporation - initial API and implementation 
10
 ****************************************************************************/
11
12
package org.eclipse.gmf.runtime.diagram.ui.printing.render.dialogs;
13
14
import java.util.Locale;
15
16
import javax.print.DocFlavor;
17
import javax.print.PrintService;
18
import javax.print.PrintServiceLookup;
19
import javax.print.attribute.AttributeSet;
20
import javax.print.attribute.HashPrintServiceAttributeSet;
21
import javax.print.attribute.PrintServiceAttributeSet;
22
import javax.print.attribute.standard.ColorSupported;
23
import javax.print.attribute.standard.PrinterName;
24
25
import org.eclipse.core.databinding.DataBindingContext;
26
import org.eclipse.core.databinding.beans.BeansObservables;
27
import org.eclipse.core.databinding.observable.Realm;
28
import org.eclipse.gmf.runtime.diagram.ui.printing.internal.l10n.DiagramUIPrintingMessages;
29
import org.eclipse.gmf.runtime.diagram.ui.printing.render.model.PrintOptions;
30
import org.eclipse.jface.databinding.swt.SWTObservables;
31
import org.eclipse.swt.widgets.Button;
32
import org.eclipse.swt.widgets.Composite;
33
import org.eclipse.swt.widgets.Control;
34
35
/**
36
 * A section of the options print dialog that handles the print color options.
37
 * 
38
 * @author James Bruck (jbruck)
39
 */
40
public class ColorBlock extends DialogBlock {
41
42
	private final DataBindingContext bindings;
43
	private final PrintOptions options;
44
45
	private Button colorRadio;
46
	private Button monoRadio;
47
48
	ColorBlock(IDialogUnitConverter dluConverter, DataBindingContext bindings,
49
			PrintOptions options) {
50
		super(dluConverter);
51
52
		this.bindings = bindings;
53
		this.options = options;
54
	}
55
56
	/*
57
	 * (non-Javadoc)
58
	 * 
59
	 * @see org.eclipse.gmf.runtime.common.ui.printing.internal.dialogs.DialogBlock#createContents(org.eclipse.swt.widgets.Composite)
60
	 */
61
	public Control createContents(Composite parent) {
62
		final Realm realm = bindings.getValidationRealm();
63
64
		Composite result = group(parent,
65
				DiagramUIPrintingMessages.JPSOptionsDialog_Color);
66
		layout(result, 2);
67
68
		colorRadio = radio(result,
69
				DiagramUIPrintingMessages.JPSOptionsDialog_ChromaticityColor);
70
		layoutSpanHorizontal(colorRadio, 4);
71
72
		monoRadio = radio(
73
				result,
74
				DiagramUIPrintingMessages.JPSOptionsDialog_ChromaticityMonochrome);
75
		layoutSpanHorizontal(monoRadio, 4);
76
77
		bindings.bindValue(SWTObservables.observeSelection(colorRadio),
78
				BeansObservables.observeValue(realm, options,
79
						PrintOptions.PROPERTY_CHROMATICITY_COLOR), null, null);
80
81
		bindings.bindValue(SWTObservables.observeSelection(monoRadio),
82
				BeansObservables.observeValue(realm, options,
83
						PrintOptions.PROPERTY_CHROMATICITY_MONO), null, null);
84
85
		initializeControls(options.getDestination().getName());
86
87
		return result;
88
	}
89
90
	/**
91
	 * Initialize the enabled state of the controls based on the printer
92
	 * capabilities.
93
	 * 
94
	 * @param printerName
95
	 */
96
	private void initializeControls(String printerName) {
97
98
		AttributeSet attributes = new HashPrintServiceAttributeSet(
99
				new PrinterName(printerName, Locale.getDefault()));
100
101
		PrintService[] services = PrintServiceLookup.lookupPrintServices(
102
				DocFlavor.SERVICE_FORMATTED.PRINTABLE, attributes);
103
104
		PrintService printService = services[0];
105
106
		PrintServiceAttributeSet printServiceAttributes = printService
107
				.getAttributes();
108
109
		ColorSupported colorSupported = (ColorSupported) printServiceAttributes
110
				.get(ColorSupported.class);
111
		
112
		if (colorSupported == ColorSupported.SUPPORTED) {
113
			options.setChromaticityColor(true);
114
			options.setChromaticityMono(false);
115
			colorRadio.setEnabled(true);
116
		} else {
117
			options.setChromaticityColor(false);
118
			options.setChromaticityMono(true);
119
			colorRadio.setEnabled(false);
120
		}
121
	}
122
123
}
(-)plugin.xml (-2 / +4 lines)
Lines 24-35 Link Here
24
   </extension>
24
   </extension>
25
   
25
   
26
    <extension id="printingExperimentalContributionItemProvider" name="Printing_Experimental" point="org.eclipse.gmf.runtime.common.ui.services.action.contributionItemProviders">
26
    <extension id="printingExperimentalContributionItemProvider" name="Printing_Experimental" point="org.eclipse.gmf.runtime.common.ui.services.action.contributionItemProviders">
27
      <contributionItemProvider class="org.eclipse.gmf.runtime.diagram.ui.render.internal.providers.PrintingExperimentalContributionItemProvider">
27
      <contributionItemProvider
28
            checkPluginLoaded="false"
29
            class="org.eclipse.gmf.runtime.diagram.ui.render.internal.providers.PrintingExperimentalContributionItemProvider">
28
         <Priority name="Medium">
30
         <Priority name="Medium">
29
         </Priority>
31
         </Priority>
30
         <partContribution class="org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart">
32
         <partContribution class="org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart">
31
            <partAction
33
            <partAction
32
                  global="false"
34
                  global="true"
33
                  id="printExperimentalAction"
35
                  id="printExperimentalAction"
34
                  menubarPath="/file/print">
36
                  menubarPath="/file/print">
35
            </partAction>
37
            </partAction>
(-)src/org/eclipse/gmf/runtime/draw2d/ui/render/awt/internal/graphics/GraphicsToGraphics2DAdaptor.java (-3 / +18 lines)
Lines 1-5 Link Here
1
/******************************************************************************
1
/******************************************************************************
2
 * Copyright (c) 2004, 2007 IBM Corporation and others.
2
 * Copyright (c) 2004, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 461-467 Link Here
461
		int w2,
461
		int w2,
462
		int h2) {
462
		int h2) {
463
463
464
		drawImage(srcImage, x2, y2);
464
		x2 += transX;
465
		y2 += transY;
466
467
		BufferedImage toDraw = ImageConverter.convert(srcImage);
468
		checkState();
469
		getGraphics2D().drawImage(toDraw, x2, y2, w2, h2, null);
465
	}
470
	}
466
471
467
	/*
472
	/*
Lines 1227-1231 Link Here
1227
            getGraphics2D().setComposite(newComposite);
1232
            getGraphics2D().setComposite(newComposite);
1228
        }
1233
        }
1229
    }
1234
    }
1230
1235
    
1236
    protected BasicStroke getStroke(){
1237
    	return stroke;
1238
    }
1239
    
1240
    protected void setStroke(BasicStroke stroke){
1241
    	this.stroke = stroke;
1242
    	getGraphics2D().setStroke(stroke);
1243
    }
1244
    
1245
   
1231
}
1246
}
(-)src/org/eclipse/gmf/runtime/diagram/ui/printing/internal/l10n/DiagramUIPrintingMessages.java (-1 / +15 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 67-72 Link Here
67
	public static String JPSPrintDialog_PagesTall;
67
	public static String JPSPrintDialog_PagesTall;
68
	public static String JPSDiagramPrinterUtil_ErrorTitle;
68
	public static String JPSDiagramPrinterUtil_ErrorTitle;
69
	public static String JPSDiagramPrinterUtil_ErrorMessage;
69
	public static String JPSDiagramPrinterUtil_ErrorMessage;
70
	public static String JPSOptionsDialog_Quality;
71
	public static String JPSOptionsDialog_QualityHigh;
72
	public static String JPSOptionsDialog_QualityMedium;
73
	public static String JPSOptionsDialog_QualityLow;
74
	public static String JPSOptionsDialog_Color;
75
	public static String JPSOptionsDialog_ChromaticityColor;
76
	public static String JPSOptionsDialog_ChromaticityMonochrome;
77
	public static String JPSOptionsDialog_JobAttributes;
78
	public static String JPSOptionsDialog_JobName;
79
	public static String JPSOptionsDialog_Sides;
80
	public static String JPSOptionsDialog_SidesOneSided;
81
	public static String JPSOptionsDialog_SidesTumble;
82
	public static String JPSOptionsDialog_SidesDuplex;
83
	public static String JPSOptionsDialog_AdvancedOptions;
70
				
84
				
71
	static {
85
	static {
72
		NLS.initializeMessages(BUNDLE_NAME, DiagramUIPrintingMessages.class);
86
		NLS.initializeMessages(BUNDLE_NAME, DiagramUIPrintingMessages.class);
(-)src/org/eclipse/gmf/runtime/diagram/ui/printing/internal/l10n/DiagramUIPrintingMessages.properties (+16 lines)
Lines 58-63 Link Here
58
JPSPrintDialog_PagesWide=Pages &wide:
58
JPSPrintDialog_PagesWide=Pages &wide:
59
JPSPrintDialog_PagesTall=Pages &tall:
59
JPSPrintDialog_PagesTall=Pages &tall:
60
60
61
JPSOptionsDialog_Quality=Quality
62
JPSOptionsDialog_QualityHigh=&High
63
JPSOptionsDialog_QualityMedium=&Medium
64
JPSOptionsDialog_QualityLow=&Low
65
JPSOptionsDialog_Color=Color
66
JPSOptionsDialog_ChromaticityColor=&Color
67
JPSOptionsDialog_ChromaticityMonochrome=&Monochrome
68
JPSOptionsDialog_JobAttributes=Job Attributes
69
JPSOptionsDialog_JobName=Job &Name
70
JPSOptionsDialog_Sides=Sides
71
JPSOptionsDialog_SidesOneSided=&One Sided
72
JPSOptionsDialog_SidesTumble=&Tumble
73
JPSOptionsDialog_SidesDuplex=&Duplex
74
JPSOptionsDialog_AdvancedOptions=Advanced Options
75
76
61
# DiagramPrinterUtil related resource strings
77
# DiagramPrinterUtil related resource strings
62
# ================================ BEGIN ==================================================
78
# ================================ BEGIN ==================================================
63
DiagramPrinterUtil_DLLErrorTitle=Error loading printing library
79
DiagramPrinterUtil_DLLErrorTitle=Error loading printing library

Return to bug 224387