X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.utils.ui%2Fsrc%2Forg%2Fsimantics%2Futils%2Fui%2Fcolor%2FColorGradientDialog.java;fp=bundles%2Forg.simantics.utils.ui%2Fsrc%2Forg%2Fsimantics%2Futils%2Fui%2Fcolor%2FColorGradientDialog.java;h=7071e82b350231399483db9f9644e347cba15e64;hp=17b56c4746fa8337e56bc11d008b75397236967b;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/color/ColorGradientDialog.java b/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/color/ColorGradientDialog.java index 17b56c474..7071e82b3 100644 --- a/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/color/ColorGradientDialog.java +++ b/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/color/ColorGradientDialog.java @@ -1,75 +1,75 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -/* - * - * @author Toni Kalajainen - */ -package org.simantics.utils.ui.color; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; - -public class ColorGradientDialog extends Dialog { - - ColorGradientComposite composite; - ColorGradient value; - - protected ColorGradientDialog(Shell parentShell, ColorGradient initialValue) { - super(parentShell); - setShellStyle( getShellStyle() | SWT.RESIZE ); - value = new ColorGradient(initialValue); - } - - @Override - protected Point getInitialSize() { - return new Point(400, 400); - } - - @Override - protected Control createDialogArea(Composite parent) { - composite = new ColorGradientComposite(parent, 0); - GridData childData = new GridData(GridData.FILL_BOTH); - composite.setLayoutData(childData); - composite.setGradient(value); - return composite; - } - - @Override - protected void createButtonsForButtonBar(Composite parent) { - // create OK and Cancel buttons by default - createButton(parent, IDialogConstants.OK_ID, - IDialogConstants.OK_LABEL, true); - createButton(parent, IDialogConstants.CANCEL_ID, - IDialogConstants.CANCEL_LABEL, false); - } - - @Override - protected void okPressed() { - value = composite.getGradient(); - super.okPressed(); - } - - public ColorGradient getGradient() { - return value; - } - - public void setGradient(ColorGradient gradient) { - this.value = gradient; - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +/* + * + * @author Toni Kalajainen + */ +package org.simantics.utils.ui.color; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; + +public class ColorGradientDialog extends Dialog { + + ColorGradientComposite composite; + ColorGradient value; + + protected ColorGradientDialog(Shell parentShell, ColorGradient initialValue) { + super(parentShell); + setShellStyle( getShellStyle() | SWT.RESIZE ); + value = new ColorGradient(initialValue); + } + + @Override + protected Point getInitialSize() { + return new Point(400, 400); + } + + @Override + protected Control createDialogArea(Composite parent) { + composite = new ColorGradientComposite(parent, 0); + GridData childData = new GridData(GridData.FILL_BOTH); + composite.setLayoutData(childData); + composite.setGradient(value); + return composite; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + // create OK and Cancel buttons by default + createButton(parent, IDialogConstants.OK_ID, + IDialogConstants.OK_LABEL, true); + createButton(parent, IDialogConstants.CANCEL_ID, + IDialogConstants.CANCEL_LABEL, false); + } + + @Override + protected void okPressed() { + value = composite.getGradient(); + super.okPressed(); + } + + public ColorGradient getGradient() { + return value; + } + + public void setGradient(ColorGradient gradient) { + this.value = gradient; + } + +}