当前位置: 首页>>代码示例>>Java>>正文


Java SWT.ARROW_UP属性代码示例

本文整理汇总了Java中org.eclipse.swt.SWT.ARROW_UP属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.ARROW_UP属性的具体用法?Java SWT.ARROW_UP怎么用?Java SWT.ARROW_UP使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.swt.SWT的用法示例。


在下文中一共展示了SWT.ARROW_UP属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBounds

protected void getBounds(KeyEvent event,
		org.eclipse.draw2d.geometry.Rectangle bounds) {
	switch (event.keyCode){
	case SWT.ARROW_UP:
		bounds.setLocation(bounds.x , bounds.y - 10);
		break;
	case SWT.ARROW_DOWN:
		bounds.setLocation(bounds.x , bounds.y + 10);
		break;
	case SWT.ARROW_RIGHT:
		bounds.setLocation(bounds.x + 10, bounds.y);
		break;
	case SWT.ARROW_LEFT:
		bounds.setLocation(bounds.x - 10 , bounds.y);
		break;
		}
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:ELTGraphicalEditor.java

示例2: cursorMoved

/**
 * Tests if a given key event may move the current cursor position.
 * @param event the key event
 * @return <code>true</code> if the key event may move the current cursor position, otherwise <code>false</code>
 */
private boolean cursorMoved(Event event) {
    final int key = (SWT.KEY_MASK & event.keyCode);
    switch (key) {
        case SWT.ARROW_DOWN:
        case SWT.ARROW_LEFT:
        case SWT.ARROW_RIGHT: 
        case SWT.ARROW_UP: 
        case SWT.HOME:
        case SWT.END: 
        case SWT.PAGE_DOWN:
            return true;
    }
    return false;
}
 
开发者ID:liaoziyang,项目名称:ContentAssist,代码行数:19,代码来源:DocumentManager.java

示例3: onKeyDown

protected void onKeyDown(KeyEvent e) {
  boolean focusChanged = false;
  int newFocusRow = m_FocusRow;
  int newFocusCol = m_FocusCol;

  if (m_Model == null)
    return;

  if ((e.character == ' ') || (e.character == '\r')) {
    openEditorInFocus();
    return;
  } else if (e.keyCode == SWT.HOME) {
    newFocusCol = m_Model.getFixedColumnCount();
    if (newFocusRow == -1)
      newFocusRow = m_Model.getFixedRowCount();
    focusChanged = true;
  } else if (e.keyCode == SWT.END) {
    newFocusCol = m_Model.getColumnCount() - 1;
    if (newFocusRow == -1)
      newFocusRow = m_Model.getFixedRowCount();
    focusChanged = true;
  } else if (e.keyCode == SWT.ARROW_LEFT) {
    if (!m_RowSelectionMode) {
      if (newFocusCol > m_Model.getFixedColumnCount())
        newFocusCol--;
    }
    focusChanged = true;
  } else if (e.keyCode == SWT.ARROW_RIGHT) {
    if (!m_RowSelectionMode) {
      if (newFocusCol == -1) {
        newFocusCol = m_Model.getFixedColumnCount();
        newFocusRow = m_Model.getFixedRowCount();
      } else if (newFocusCol < m_Model.getColumnCount() - 1)
        newFocusCol++;
    }
    focusChanged = true;
  } else if (e.keyCode == SWT.ARROW_DOWN) {
    if (newFocusRow == -1) {
      newFocusRow = m_Model.getFixedRowCount();
      newFocusCol = m_Model.getFixedColumnCount();
    } else if (newFocusRow < m_Model.getRowCount() - 1)
      newFocusRow++;
    focusChanged = true;
  } else if (e.keyCode == SWT.ARROW_UP) {
    if (newFocusRow > m_Model.getFixedRowCount())
      newFocusRow--;
    focusChanged = true;
  } else if (e.keyCode == SWT.PAGE_DOWN) {
    newFocusRow += m_RowsVisible - 1;
    if (newFocusRow >= m_Model.getRowCount())
      newFocusRow = m_Model.getRowCount() - 1;
    if (newFocusCol == -1)
      newFocusCol = m_Model.getFixedColumnCount();
    focusChanged = true;
  } else if (e.keyCode == SWT.PAGE_UP) {
    newFocusRow -= m_RowsVisible - 1;
    if (newFocusRow < m_Model.getFixedRowCount())
      newFocusRow = m_Model.getFixedRowCount();
    if (newFocusCol == -1)
      newFocusCol = m_Model.getFixedColumnCount();
    focusChanged = true;
  }

  if (focusChanged) {

    focusCell(newFocusCol, newFocusRow, e.stateMask);

    if (!isCellFullyVisible(m_FocusCol, m_FocusRow))
      scrollToFocus();
  }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:71,代码来源:KTable.java

示例4: keyPressed

@Override
public void keyPressed(KeyEvent e) {
	final PossibleStepEditPart toSelect;
	final List<?> selected = timelineViewer.getSelectedEditParts();
	if (selected.size() == 1 && selected.get(0) instanceof PossibleStepEditPart) {
		final PossibleStepEditPart part = (PossibleStepEditPart)selected.get(0);
		switch (e.keyCode) {
			case SWT.ARROW_LEFT:
				// shift the TimelineWindow if needed
				if (timelineWindow.getStart() > part.getModel().getChoice().getIndex() - 1
						&& part.getModel().getChoice().getIndex() - 1 >= 0) {
					if (follow) {
						toggleFollow();
					}
					timelineWindow.setStart(timelineWindow.getStart() - 1);
				}
				toSelect = part.getLeftPossibleStepEditPart();
				break;

			case SWT.ARROW_RIGHT:
				// shift the TimelineWindow if needed
				if (timelineWindow.getEnd() <= part.getModel().getChoice().getIndex() + 1
						&& part.getModel().getChoice().getIndex() + 1 <= timelineWindow
								.getMaxTimelineIndex()
								+ nbVirtualChoices) {
					timelineWindow.setStart(timelineWindow.getStart() + 1);
				}
				toSelect = part.getRightPossibleStepEditPart();
				break;

			case SWT.ARROW_UP:
				toSelect = part.getAbovePossibleStepEditPart();
				break;

			case SWT.ARROW_DOWN:
				toSelect = part.getBeneathPossibleStepEditPart();
				break;

			default:
				toSelect = null;
				break;
		}

		if (toSelect != null) {
			timelineViewer.getSelectionManager().deselectAll();
			timelineViewer.getSelectionManager().appendSelection(toSelect);
			part.getViewer().reveal(toSelect);
		}
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:50,代码来源:AbstractTimelineView.java


注:本文中的org.eclipse.swt.SWT.ARROW_UP属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。