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


Java MouseEvent.isShiftDown方法代码示例

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


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

示例1: mouseClicked

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
public void mouseClicked(MouseEvent e) {

            JTableHeader     h           = (JTableHeader) e.getSource();
            TableColumnModel columnModel = h.getColumnModel();
            int viewColumn = columnModel.getColumnIndexAtX(e.getX());
            int column = columnModel.getColumn(viewColumn).getModelIndex();

            if (column != -1) {
                int status = getSortingStatus(column);

                if (!e.isControlDown()) {
                    cancelSorting();
                }

                // Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or
                // {NOT_SORTED, DESCENDING, ASCENDING} depending on whether shift is pressed.
                status = status + (e.isShiftDown() ? -1
                                                   : 1);
                status = (status + 4) % 3 - 1;    // signed mod, returning {-1, 0, 1}

                setSortingStatus(column, status);
            }
        }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:24,代码来源:TableSorter.java

示例2: mouseClicked

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
public void mouseClicked(MouseEvent e) {

            JTableHeader     h           = (JTableHeader) e.getSource();
            TableColumnModel columnModel = h.getColumnModel();
            int              viewColumn  = h.columnAtPoint(e.getPoint());
            int column = columnModel.getColumn(viewColumn).getModelIndex();

            if (column != -1) {
                int status = getSortingStatus(column);

                if (!e.isControlDown()) {
                    cancelSorting();
                }

                // Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or
                // {NOT_SORTED, DESCENDING, ASCENDING} depending on whether shift is pressed.
                status = status + (e.isShiftDown() ? -1
                                                   : 1);
                status = (status + 4) % 3 - 1;    // signed mod, returning {-1, 0, 1}

                setSortingStatus(column, status);
            }
        }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:24,代码来源:TableSorter.java

示例3: mousePressed

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mousePressed(MouseEvent e) {
	stopEditing(table);
	row0 = rowAtPoint(e.getPoint());
	int row0b = row0;
	if (row0 >= 0) {
		if (e.isShiftDown()) {
			row0b = table.getSelectionModel().getAnchorSelectionIndex();
		}
		table.setRowSelectionInterval(row0b, row0);
		table.setColumnSelectionInterval(0, table.getColumnCount() - 1);
		//selectionModel.setAnchorSelectionIndex(0);
		//columnModel.getSelectionModel().setAnchorSelectionIndex(col0);
		table.requestFocus();
	}
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:17,代码来源:RowHeader.java

示例4: mouseClicked

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseClicked(MouseEvent e) {
	JTableHeader h = (JTableHeader) e.getSource();
	TableColumnModel columnModel = h.getColumnModel();
	int viewColumn = getSortingColumnIndex(h, e.getPoint());
	if (viewColumn != -1) {
		int column = columnModel.getColumn(viewColumn).getModelIndex();
		if (column != -1) {
			int status = getSortingStatus(column);
			if (!SwingTools.isControlOrMetaDown(e)) {
				cancelSorting();
			}
			// Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or
			// {NOT_SORTED, DESCENDING, ASCENDING} depending on whether shift is
			// pressed.
			status = status + (e.isShiftDown() ? -1 : 1);
			status = (status + 4) % 3 - 1; // signed mod, returning {-1, 0, 1}
			setSortingStatus(column, status);
		}
		e.consume();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:23,代码来源:ExtendedJTableSorterModel.java

示例5: mouseClicked

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseClicked(MouseEvent e)
{
	JTableHeader h = (JTableHeader) e.getSource();
	TableColumnModel columnModel = h.getColumnModel();
	int viewColumn = columnModel.getColumnIndexAtX(e.getX());
	int column = columnModel.getColumn(viewColumn).getModelIndex();
	if( column != -1 )
	{
		int status = getSortingStatus(column);
		if( !e.isControlDown() )
		{
			cancelSorting();
		}
		// Cycle the sorting states through {NOT_SORTED, ASCENDING,
		// DESCENDING} or
		// {NOT_SORTED, DESCENDING, ASCENDING} depending on whether
		// shift is pressed.
		status = status + (e.isShiftDown() ? -1 : 1);
		status = (status + 4) % 3 - 1; // signed mod, returning {-1, 0,
		// 1}
		setSortingStatus(column, status);
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:25,代码来源:TableSorter.java

示例6: select

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
void select( MouseEvent e) {
	if( !map.isSelectable() ) return;
	double zoom = map.getZoom();
	double radius = 3./Math.pow(zoom, .75);
	double r2 = radius*radius;
	double wrap = map.getWrap();
	Point2D p = map.getScaledPoint(e.getPoint());
	if( !e.isShiftDown() ) table.clearSelection();
	int xyIndex = headings.size()+1;
	for( int k=0 ; k<currentRowsIndices.size() ; k++) {
		Vector row = getCurrentRow(k);
		float[] xy = (float[])row.get(xyIndex);
		double offset = 0.;
		while( xy[0]+offset<p.getX()-radius ) offset+=wrap;
		while( xy[0]+offset>p.getX()+radius ) offset-=wrap;
		if( xy[0]+offset<p.getX()-radius )continue;
		double r = p.distanceSq( offset+xy[0], (double)xy[1]);
		if( r < r2) {
			table.getSelectionModel().addSelectionInterval(k,k);
			table.ensureIndexIsVisible(k);
		}
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:24,代码来源:GMATable.java

示例7: mousePressed

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
public void mousePressed(MouseEvent e) {
	
	if (station){
		//This will detect if the mouse clicks on a datapoint 
		//and will set the selectedRow value.  Used for dragging.
		selectedRow = -1;
		selectPoint(e);
	}		
	
	if (e.isControlDown()) return;
	if (e.isConsumed()||!map.isSelectable()) return;

	if (db.panTB.isSelected()) return;
	if (e.isShiftDown()) {
		p1=e.getPoint();
		p2=new Point(p1.x+1,p1.y+1);
		drawSelectionBox();
	}
	else {
		poly = new Polygon();
		poly.addPoint(e.getPoint().x, e.getPoint().y);
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:24,代码来源:UnknownDataSet.java

示例8: mouseDragged

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseDragged(MouseEvent e) {
    if (currentProfile == null) {
        return;
    }
    int idx = -1;
    if ((idx = getIndex(e)) == -1) {
        return;
    }
    if (idx != lastEditIdx) {
        if (e.isAltDown() && e.isShiftDown()) {
            // brake point
            currentProfile.editClearBrake(idx);
            currentProfile.log();
            editState = EditState.None;
            glCanvas.repaint();
        } else if (e.isAltDown() && !e.isShiftDown()) {
            // brake point
            currentProfile.editSetBrake(idx);
            currentProfile.log();
            editState = EditState.None;
            glCanvas.repaint();
        } else if (isShift(e)) {
            currentProfile.editIncreaseThrottle(idx);
            currentProfile.log();
            editState = EditState.Increae;
            glCanvas.repaint();
        } else if (isControl(e)) {
            currentProfile.editDecreaseThrottle(idx);
            currentProfile.log();
            editState = EditState.Decrease;
            glCanvas.repaint();
        } else {
            editState = EditState.None;
        }
    }
    lastEditIdx = idx;
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:39,代码来源:EvolutionaryThrottleController.java

示例9: isMultiselectPressed

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
public static boolean isMultiselectPressed(MouseEvent evt) {
    if(evt.isShiftDown()) {
        return true;
    }
    if(!isAqua() && evt.isControlDown()) {
        return true;
    }
    return false;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:DropTargetLayer.java

示例10: mouseDragged

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
public void mouseDragged(MouseEvent e) {
	if (e.isShiftDown()) {
		return; //ignore drag when shift is pressed
	}
	int col1 = columnAtPoint(e.getPoint());
	if (col0 >= 0 && col1 >= 0) {
		table.setColumnSelectionInterval(col0, col1);
		table.setRowSelectionInterval(0, table.getRowCount() - 1);
	}
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:11,代码来源:ClickableTableHeader.java

示例11: canHandleEvent

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
protected boolean canHandleEvent(MouseEvent e) {
  return !e.isShiftDown() &&
         !e.isControlDown() &&
         !e.isMetaDown() &&
          e.getClickCount() < 2 &&
         !e.isConsumed();
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:8,代码来源:PieceMover.java

示例12: mouseDragged

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseDragged(MouseEvent e) {
    if (e.isShiftDown()) return;
    
    if (bAllowDrag) {
        if (!bDragging) { // Cas particulier de la surcharge du mouse pressed par la classe fille
            mousePressed(e);
        } else {
            dragAnim.updateVelocity(dragMem, e.getPoint(), dragWhen, e.getWhen());
            map.onDragged(e.getX() - dragMem.getX(), e.getY() - dragMem.getY());
            dragMem = e.getPoint();
            dragWhen = e.getWhen();
        }
    }
}
 
开发者ID:iapafoto,项目名称:DicomViewer,代码行数:16,代码来源:PanelController.java

示例13: mouseReleased

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseReleased(MouseEvent e) {
    if (e.isShiftDown()) return;
    
    if (bDragging) {
        dragAnim.start(e.getWhen());
    }
}
 
开发者ID:iapafoto,项目名称:DicomViewer,代码行数:9,代码来源:PanelController.java

示例14: mouseClicked

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseClicked(MouseEvent e) {
    if (e.isControlDown() || e.isShiftDown() && e.getButton() != MouseEvent.BUTTON3) {
        VideoViewer viewer = VideoViewer.INSTANCE;
        if (viewer.PLAYER.isPlaying()) {
            Dimension dim = viewer.PLAYER.getVideoDimension();
            if (e.getButton() == MouseEvent.BUTTON1) {
                updateVisibility(false);
            } else {
                updateVisibility(true);
            }
            YtQueueFrame frame = YtQueueFrame.INSTANCE;
            int x = frame.getX(), y = frame.getY(), w = frame.getWidth(), h = frame.getHeight();
            double simillar = dim.width / (double) w;
            if (e.isShiftDown()) {
                simillar = 1;
            }
            dim.width = (int) (dim.width / simillar);
            dim.height = (int) (dim.height / simillar) +
                         (e.getButton() != MouseEvent.BUTTON2 ? 0 : SearchPanel.INSTANCE.getHeight() +
                                                                    VideoViewer.INSTANCE.MANAGER.getHeight());
            frame.setBounds(x + w - dim.width, y + h - dim.height, dim.width, dim.height);
        }
    }
    if (e.getClickCount() == 2) {
        if (e.getButton() == MouseEvent.BUTTON1) {
            updateVisibility(!SearchPanel.INSTANCE.isVisible());
        } else if (e.getButton() == MouseEvent.BUTTON2) {
            close();
        }
    }
}
 
开发者ID:RanolP,项目名称:YtQueue,代码行数:33,代码来源:YtQueueFrame.java

示例15: mousePressed

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mousePressed(MouseEvent e) {
    if (e.isShiftDown()) return;
            
    e.getComponent().requestFocus();
    if (e.getButton() == MouseEvent.BUTTON1) {
        dragAnim.stop();
        bDragging = true;
        dragMem = e.getPoint();
        dragWhen = e.getWhen();
    }
}
 
开发者ID:iapafoto,项目名称:DicomViewer,代码行数:13,代码来源:PanelController.java


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