/**********************************************************************
- * 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 java.util.Timer;
// Methods
// ------------------------------------------------------------------------
- /*
- * (non-Javadoc)
- * @see org.eclipse.swt.widgets.Composite#setFocus()
- */
@Override
public boolean setFocus() {
return fViewControl.forceFocus();
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.swt.widgets.Control#setCursor(org.eclipse.swt.graphics.Cursor)
- */
@Override
public void setCursor(Cursor cursor) {
fViewControl.setCursor(cursor);
}
- /*
- * Dispose controls used in scroll view
- *
- * (non-Javadoc)
- * @see org.eclipse.swt.widgets.Widget#dispose()
- */
@Override
public void dispose() {
if (fAutoScroll != null) {
super.dispose();
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.swt.widgets.Composite#getClientArea()
- */
@Override
public Rectangle getClientArea() {
return fViewControl.getClientArea();
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.swt.widgets.Control#setBackground(org.eclipse.swt.graphics.Color)
- */
@Override
public void setBackground(Color c) {
super.setBackground(c);
fViewControl.setBackground(c);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.swt.widgets.Control#setToolTipText(java.lang.String)
- */
@Override
public void setToolTipText(String text) {
fViewControl.setToolTipText(text);
* Called when the mouse enter the ScrollView area
*
* @param e
+ * Mouse event
*/
protected void contentsMouseExit(MouseEvent e) {
}
/**
- * Called when the mouse enter the ScrollView area after and system defined time
+ * Called when the mouse enter the ScrollView area after and system defined
+ * time
*
* @param e
+ * Mouse event
*/
protected void contentsMouseHover(MouseEvent e) {
}
* Called when the mouse enter the ScrollView area
*
* @param e
+ * Mouse event
*/
protected void contentsMouseEnter(MouseEvent e) {
}
* Called when user double on contents area.
*
* @param e
+ * Mouse event
*/
protected void contentsMouseDoubleClickEvent(MouseEvent e) {
}
* Called when mouse is on contents area and button is pressed.
*
* @param e
+ * Mouse event
*/
protected void contentsMouseDownEvent(MouseEvent e) {
fMouseDownX = e.x;
* TimerTask for auto scroll feature.
*/
protected static class AutoScroll extends TimerTask {
+
+ /** X delta */
public int deltaX;
+
+ /** Y delta */
public int deltaY;
+
+ /** ScrollView object */
public ScrollView scrollView;
+ /**
+ * Constructor.
+ *
+ * @param sv
+ * ScrollView object to use
+ * @param dx
+ * X delta
+ * @param dy
+ * Y delta
+ */
public AutoScroll(ScrollView sv, int dx, int dy) {
scrollView = sv;
deltaX = dx;
* Called when mouse is on contents area and mode.
*
* @param event
+ * Mouse event
*/
protected void contentsMouseMoveEvent(MouseEvent event) {
if ((event.stateMask & SWT.BUTTON_MASK) != 0) {
* Called when mouse is on contents area and button is released
*
* @param event
+ * Mouse event
*/
protected void contentsMouseUpEvent(MouseEvent event) {
// reset auto scroll if it's engaged
}
/**
- * Responsible to draw contents area. At least rectangle clipX must be redrawn. This rectangle is given in contents
- * coordinates. By default, no paint is produced.
+ * Responsible to draw contents area. At least rectangle clipX must be
+ * redrawn. This rectangle is given in contents coordinates. By default, no
+ * paint is produced.
*
* @param gc
+ * Graphics context
* @param clipx
+ * X clip
* @param clipy
+ * Y clip
* @param clipw
+ * W clip
* @param cliph
+ * H clip
*/
protected void drawContents(GC gc, int clipx, int clipy, int clipw, int cliph) {
}
return true;
}
- // redefined to return our vertical bar
- /*
- * (non-Javadoc)
- * @see org.eclipse.swt.widgets.Scrollable#getVerticalBar()
- */
@Override
public ScrollBar getVerticalBar() {
return fVertScrollBar.getVerticalBar();
}
- // redefined to return out horizontal bar
- /*
- * (non-Javadoc)
- * @see org.eclipse.swt.widgets.Scrollable#getHorizontalBar()
- */
@Override
public ScrollBar getHorizontalBar() {
return fHorScrollBar.getHorizontalBar();
}
/**
- * setup scroll bars visibility, return true if one of visibility changed.
+ * Setup scroll bars visibility.
+ *
+ * @return True if one of visibility changed.
*/
protected boolean updateScrollBarVisiblity() {
boolean change = false;
}
/**
- * Add support for arrow key, scroll the ... scroll view. But you can redefine this method for your convenience.
+ * Add support for arrow key, scroll the ... scroll view. But you can
+ * redefine this method for your convenience.
+ *
+ * @param event
+ * Keyboard event
*/
protected void keyPressedEvent(KeyEvent event) {
switch (event.keyCode) {
return bh + 1;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.swt.widgets.Scrollable#computeTrim(int, int, int, int)
- */
@Override
public Rectangle computeTrim(int x, int y, int w, int h) {
Rectangle r = new Rectangle(x, y, w, h);
*/
boolean dontLayout = false;
- /*
- * (non-Javadoc)
- * @see org.eclipse.swt.widgets.Layout#computeSize(org.eclipse.swt.widgets.Composite, int, int, boolean)
- */
@Override
protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
Point p = new Point(250, 250);
return p;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.swt.widgets.Layout#layout(org.eclipse.swt.widgets.Composite, boolean)
- */
@Override
protected void layout(Composite composite, boolean flushCache) {
if (dontLayout) {
/**
* Process overview appear
+ *
+ * @param mx
+ * X coordinate
+ * @param my
+ * Y coordinate
*/
protected void overviewAppear(int mx, int my) {
if (fOverview == null) {
/**
* Convert overview coordinates to global coordinates.
*
- * @param loc the control reference
- * @param x The x coordinate to convert
- * @param y The y coordinate to convert
- * @return
+ * @param loc
+ * the control reference
+ * @param x
+ * The x coordinate to convert
+ * @param y
+ * The y coordinate to convert
+ * @return The new converted Point
*/
protected Point toGlobalCoordinates(Control loc, int x, int y) {
Point p = new Point(x, y);