/**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * Copyright (c) 2011, 2012 Ericsson.
- *
+ * Copyright (c) 2005, 2013 IBM Corporation, Ericsson
* 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 - Initial API and implementation
- * Bernd Hufmann - Updated for TMF
+ * IBM - Initial API and implementation
+ * Bernd Hufmann - Updated for TMF
**********************************************************************/
+
package org.eclipse.linuxtools.tmf.ui.views.uml2sd;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IColor;
// Methods
// ------------------------------------------------------------------------
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#setLineStyle(int)
- */
@Override
public void setLineStyle(int style) {
fContext.setLineStyle(style);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getLineStyle()
- */
@Override
public int getLineStyle() {
return fContext.getLineStyle();
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getContentsX()
- */
@Override
public int getContentsX() {
return Math.round(fView.getContentsX() / fView.fZoomValue);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getContentsY()
- */
@Override
public int getContentsY() {
return Math.round(fView.getContentsY() / fView.fZoomValue);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getVisibleWidth()
- */
@Override
public int getVisibleWidth() {
return Math.round(fView.getVisibleWidth() / fView.fZoomValue);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getVisibleHeight()
- */
@Override
public int getVisibleHeight() {
return Math.round(fView.getVisibleHeight() / fView.fZoomValue);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#contentsToViewX(int)
- */
@Override
public int contentsToViewX(int x) {
return fView.contentsToViewX(x);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#contentsToViewY(int)
- */
@Override
public int contentsToViewY(int y) {
return fView.contentsToViewY(y);
return c;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#drawLine(int, int, int, int)
- */
@Override
public void drawLine(int x1, int y1, int x2, int y2) {
int localX1 = x1;
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#drawRectangle(int, int, int, int)
- */
@Override
public void drawRectangle(int x, int y, int width, int height) {
int localX = x;
fContext.drawRectangle(localX, localY, localWidth, localHeight);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#drawFocus(int, int, int, int)
- */
@Override
public void drawFocus(int x, int y, int width, int height) {
int localX = x;
setForeground(fC);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#fillPolygon(int[])
- */
@Override
public void fillPolygon(int[] points) {
int len = (points.length / 2) * 2;
fContext.fillPolygon(localPoint);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#drawPolygon(int[])
- */
@Override
public void drawPolygon(int[] points) {
int len = (points.length / 2) * 2;
fContext.drawPolygon(localPoint);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#fillRectangle(int, int, int, int)
- */
@Override
public void fillRectangle(int x, int y, int width, int height) {
int localX = x;
localHeight = fView.getVisibleHeight() + fVisibleScreenBounds - localY;
}
fContext.fillRectangle(localX, localY, localWidth, localHeight);
-
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#fillGradientRectangle(int, int, int, int, boolean)
- */
@Override
public void fillGradientRectangle(int x, int y, int width, int height, boolean isVertical) {
int localX = x;
setForeground(tempColor);
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#textExtent(java.lang.String)
- */
@Override
public int textExtent(String name) {
return fContext.textExtent(name).x;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#drawText(java.lang.String, int, int, boolean)
- */
@Override
public void drawText(String string, int x, int y, boolean isTrans) {
int localX = x;
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#drawText(java.lang.String, int, int)
- */
@Override
public void drawText(String string, int x, int y) {
int localX = x;
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#fillOval(int, int, int, int)
- */
@Override
public void fillOval(int x, int y, int width, int height) {
int localX = x;
fContext.fillOval(fView.contentsToViewX(localX), fView.contentsToViewY(localY), localWidth, localHeight);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getBackground()
- */
@Override
public IColor getBackground() {
if ((fBackground != null) && (fBackground.getColor() instanceof Color) && (!((Color) (fBackground.getColor())).isDisposed())) {
return ColorImpl.getSystemColor(SWT.COLOR_WHITE);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getForeground()
- */
@Override
public IColor getForeground() {
if ((fForeground != null) && (fForeground.getColor() instanceof Color) && (!((Color) (fForeground.getColor())).isDisposed())) {
return ColorImpl.getSystemColor(SWT.COLOR_WHITE);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#setBackground(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IColor)
- */
@Override
public void setBackground(IColor color) {
if (color == null) {
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#setForeground(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IColor)
- */
@Override
public void setForeground(IColor color) {
if (color == null) {
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#setGradientColor(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IColor)
- */
@Override
public void setGradientColor(IColor color) {
if (color == null) {
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#setLineWidth(int)
- */
@Override
public void setLineWidth(int width) {
if (fView.isPrinting()) {
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getLineWidth()
- */
@Override
public int getLineWidth() {
return fContext.getLineWidth();
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#drawTextTruncatedCentred(java.lang.String, int, int, int, int, boolean)
- */
@Override
public void drawTextTruncatedCentred(String name, int xValue, int yValue, int width, int height, boolean trans) {
int localX = xValue;
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#drawTextTruncated(java.lang.String, int, int, int, int, boolean)
- */
@Override
public void drawTextTruncated(String name, int xValue, int yValue, int width, int height, boolean trans) {
int localX = xValue;
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#drawImage(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IImage, int, int, int, int)
- */
@Override
public void drawImage(IImage image, int xValue, int yValue, int maxWith, int maxHeight) {
int localX = xValue;
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#drawArc(int, int, int, int, int, int)
- */
@Override
public void drawArc(int x, int y, int width, int height, int startAngle, int endAngle) {
int localX = x;
fContext.drawArc(fView.contentsToViewX(localX), fView.contentsToViewY(localY), localWidth, localHeight, startAngle, endAngle);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#setFont(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IFont)
- */
@Override
public void setFont(IFont font) {
if (font.getFont() != null && ((Font) font.getFont()).getFontData().length > 0) {
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getFontHeight(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IFont)
- */
@Override
public int getFontHeight(IFont font) {
if (font.getFont() != null && (font.getFont() instanceof Font) && ((Font) font.getFont()).getFontData().length > 0) {
return fContext.textExtent("lp").y; //$NON-NLS-1$
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getFontWidth(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IFont)
- */
@Override
public int getFontWidth(IFont font) {
if ((font.getFont() != null) && (font.getFont() instanceof Font)) {
fContext = null;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getZoom()
- */
@Override
public float getZoom() {
if (fView != null) {
return 1;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getLineDotStyle()
- */
@Override
public int getLineDotStyle() {
return SWT.LINE_DOT;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getLineDashStyle()
- */
@Override
public int getLineDashStyle() {
return SWT.LINE_DASH;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#getLineSolidStyle()
- */
@Override
public int getLineSolidStyle() {
return SWT.LINE_SOLID;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#createColor(int, int, int)
- */
@Override
public IColor createColor(int r, int g, int b) {
return new ColorImpl(Display.getDefault(), r, g, b);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC#setDrawTextWithFocusStyle(boolean)
- */
@Override
public void setDrawTextWithFocusStyle(boolean focus) {
fDrawWithFocus = focus;