diff options
Diffstat (limited to 'bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures')
8 files changed, 0 insertions, 476 deletions
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CategoryFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CategoryFigure.java deleted file mode 100644 index ad125399d4..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CategoryFigure.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.xsd.ui.internal.design.figures; - -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Figure; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.LineBorder; -import org.eclipse.draw2d.MarginBorder; -import org.eclipse.draw2d.ScrollPane; -import org.eclipse.draw2d.ToolbarLayout; -import org.eclipse.draw2d.Viewport; -import org.eclipse.draw2d.ViewportLayout; -import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure; -import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.RoundedLineBorder; -import org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout; - -public class CategoryFigure extends Figure -{ - protected ScrollPane scrollpane; - protected Figure outerPane; - public HeadingFigure headingFigure; - Figure contentPane; - - public CategoryFigure(int type) - { - super(); - - outerPane = new Figure(); - outerPane.setBorder(new RoundedLineBorder(1, 6)); - - ToolbarLayout layout = new ToolbarLayout(false); - layout.setVertical(true); - layout.setStretchMinorAxis(true); - FillLayout fillLayout = new FillLayout(3); - fillLayout.setHorizontal(false); - - FillLayout outerLayout = new FillLayout(); - outerPane.setLayoutManager(outerLayout); - - add(outerPane); - - headingFigure = new HeadingFigure(); - outerPane.add(headingFigure); - - Figure line = new Figure(); - line.setBorder(new LineBorder(1)); - ToolbarLayout lineLayout = new ToolbarLayout(false); - lineLayout.setVertical(true); - lineLayout.setStretchMinorAxis(true); - line.setLayoutManager(lineLayout); - outerPane.add(line); - - scrollpane = new ScrollPane(); - scrollpane.setForegroundColor(ColorConstants.black); - scrollpane.setVerticalScrollBarVisibility(ScrollPane.AUTOMATIC); - outerPane.add(scrollpane); - - Figure pane = new Figure(); - pane.setBorder(new MarginBorder(5, 8, 5, 8)); - ToolbarLayout toolbarLayout = new ToolbarLayout(false); - toolbarLayout.setSpacing(3); - pane.setLayoutManager(toolbarLayout); // good - - Viewport viewport = new Viewport(); - viewport.setContentsTracksHeight(true); - ViewportLayout viewportLayout = new ViewportLayout(); - viewport.setLayoutManager(viewportLayout); - - scrollpane.setViewport(viewport); - scrollpane.setContents(pane); - } - - public HeadingFigure getHeadingFigure() - { - return headingFigure; - } - - public ScrollPane getScrollPane() - { - return scrollpane; - } - - public IFigure getContentPane() - { - return scrollpane.getContents(); - } - -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java deleted file mode 100644 index 21772890b2..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2008 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.xsd.ui.internal.design.figures; - -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Graphics; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.RoundedRectangle; -import org.eclipse.draw2d.geometry.Dimension; -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; -import org.eclipse.wst.xsd.ui.internal.design.editparts.ReferenceConnection; - -public class CenteredIconFigure extends RoundedRectangle -{ - public static final int NORMAL = 0; - public static final int SELECTED = 1; - public static final int HOVER = 2; - public Image image; - protected Label toolTipLabel; - protected int mode = 0; - - public CenteredIconFigure() - { - super(); - setFill(true); - toolTipLabel = new Label(); - setCornerDimensions(new Dimension(5,5)); - } - - public CenteredIconFigure(Image img) - { - this(); - this.image = img; - } - - public void refresh() - { - repaint(); - } - - protected void outlineShape(Graphics graphics) - { - graphics.pushState(); - try - { - if (mode == NORMAL) - { // TODO: common up and organize colors.... - graphics.setForegroundColor(ReferenceConnection.inactiveConnection); - } - else if (mode == SELECTED) - { - boolean highContrast = false; - try - { - highContrast = Display.getDefault().getHighContrast(); - } - catch (Exception e) - { - } - if (highContrast) - { - graphics.setForegroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND)); - } - else - { - graphics.setForegroundColor(ColorConstants.black); - } - } - super.outlineShape(graphics); - } - finally - { - graphics.popState(); - } - } - - protected void fillShape(Graphics g) - { - super.fillShape(g); - if (image != null) - { - Rectangle r = getBounds(); - Dimension imageSize = new Dimension(15, 15); - g.drawImage(image, r.x + (r.width - imageSize.width)/2, r.y + (r.height - imageSize.height)/2 - 1); - } - } - - public Label getToolTipLabel() - { - return toolTipLabel; - } - - public void setMode(int mode) - { - this.mode = mode; - } - - public void setToolTipText(String text) - { - if (text.length() > 0) - { - setToolTip(toolTipLabel); - toolTipLabel.setText(text); - } - else - { - setToolTip(null); - } - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/GenericGroupFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/GenericGroupFigure.java deleted file mode 100644 index c0117ce8cb..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/GenericGroupFigure.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.xsd.ui.internal.design.figures; - -import org.eclipse.draw2d.Figure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.geometry.Dimension; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.swt.graphics.Image; -import org.eclipse.wst.xsd.ui.internal.design.layouts.ModelGroupLayout; - -public class GenericGroupFigure extends Figure -{ - protected CenteredIconFigure centeredIconFigure; - protected Figure contentFigure; - protected String text; - protected boolean hasText = false; - protected Label textFigure; - - public GenericGroupFigure() - { - super(); - setLayoutManager(new ModelGroupLayout(true)); - - centeredIconFigure = new CenteredIconFigure(); - centeredIconFigure.setPreferredSize(new Dimension(15, 15)); - - add(centeredIconFigure); - contentFigure = new Figure(); - contentFigure.setLayoutManager(new ModelGroupLayout(false, 0)); - add(contentFigure); - } - - public void setText(String text) - { - this.text = text; - hasText = false; - if (text != null && text.length() > 0) - { - hasText = true; - } - } - - public boolean hasText() - { - return hasText; - } - - public String getText() - { - return text; - } - - public Point getTextCoordinates() - { - Rectangle rect = centeredIconFigure.getBounds(); - return new Point(rect.x, rect.y + 14); - } - - public void setIconFigure(Image image) - { - centeredIconFigure.image = image; - } - - public CenteredIconFigure getTargetFigure() - { - return centeredIconFigure; - } - - public CenteredIconFigure getIconFigure() - { - return centeredIconFigure; - } - - public Figure getContentFigure() - { - return contentFigure; - } - - public void setToolTipText(String text) - { - centeredIconFigure.setToolTipText(text); - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/HyperLinkLabel.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/HyperLinkLabel.java deleted file mode 100644 index b4ef29f118..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/HyperLinkLabel.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.xsd.ui.internal.design.figures; - -import org.eclipse.draw2d.FigureUtilities; -import org.eclipse.draw2d.Graphics; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.geometry.Dimension; -import org.eclipse.draw2d.geometry.Point; - -public class HyperLinkLabel extends Label -{ - protected void paintFigure(Graphics graphics) - { - super.paintFigure(graphics); - graphics.setFont(getFont()); - - // TODO (cs) this lookup to find " :" is a hack - // that's specialized for element and type label text - // we need to make the TopLevelComponent use two labels in this case - // - String string = getText(); - int index = string.indexOf(" :"); - if (index != -1) - { - string = string.substring(0, index); - } - // end hack - - Point p = getTextLocation(); - Dimension textSize = FigureUtilities.getTextExtents(string, getFont()); - int textWidth = textSize.width; - int textHeight = textSize.height; - int descent = graphics.getFontMetrics().getDescent(); - int lineY = bounds.y + p.y + textHeight - descent + 1; - int lineX = bounds.x + p.x; - graphics.drawLine(lineX, lineY, lineX + textWidth, lineY); - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IExtendedFigureFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IExtendedFigureFactory.java deleted file mode 100644 index e107b577a4..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IExtendedFigureFactory.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.xsd.ui.internal.design.figures; - -import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFigureFactory; - -public interface IExtendedFigureFactory extends IFigureFactory -{ - IModelGroupFigure createModelGroupFigure(Object model); -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IModelGroupFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IModelGroupFigure.java deleted file mode 100644 index 10ff423a21..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IModelGroupFigure.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.xsd.ui.internal.design.figures; - -import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IADTFigure; - -public interface IModelGroupFigure extends IADTFigure -{ -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/ModelGroupFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/ModelGroupFigure.java deleted file mode 100644 index 7009930d7c..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/ModelGroupFigure.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.xsd.ui.internal.design.figures; - -import org.eclipse.gef.EditPart; -import org.eclipse.swt.graphics.Image; -import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin; - -public class ModelGroupFigure extends GenericGroupFigure implements IModelGroupFigure -{ - public static final Image SEQUENCE_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/sequence_obj.gif"); //$NON-NLS-1$ - public static final Image SEQUENCE_ICON_DISABLED_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/sequencedis_obj.gif"); //$NON-NLS-1$ - public static final Image CHOICE_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/choice_obj.gif"); //$NON-NLS-1$ - public static final Image CHOICE_ICON_DISABLED_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/choicedis_obj.gif"); //$NON-NLS-1$ - public static final Image ALL_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/all_obj.gif"); //$NON-NLS-1$ - public static final Image ALL_ICON_DISABLED_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/alldis_obj.gif"); //$NON-NLS-1$ - - public ModelGroupFigure() - { - super(); - } - - public void setIconFigure(Image image) - { - centeredIconFigure.image = image; - } - - public void addSelectionFeedback() - { - // TODO Auto-generated method stub - - } - - public void editPartAttached(EditPart owner) - { - // TODO Auto-generated method stub - - } - - public void refreshVisuals(Object model) - { - // TODO Auto-generated method stub - - } - - public void removeSelectionFeedback() - { - // TODO Auto-generated method stub - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/SpacingFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/SpacingFigure.java deleted file mode 100644 index fa6a55a68f..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/SpacingFigure.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.xsd.ui.internal.design.figures; - -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.MarginBorder; -import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin; - -public class SpacingFigure extends Label -{ - public SpacingFigure() - { - super(""); //$NON-NLS-1$ - setIcon(XSDEditorPlugin.getXSDImage("icons/Dot.gif")); //$NON-NLS-1$ - setBorder(new MarginBorder(3, 0, 3, 0)); - } -} |