Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
45,000 | void (MouseEvent event) { myEvent = event; } | setEvent |
45,001 | void (@Nullable EditableArea area) { myArea = area; } | setArea |
45,002 | InputTool () { return myTool; } | getActiveTool |
45,003 | void (InputTool tool) { if (myTool != null) { myTool.deactivate(); } myTool = tool; if (myTool != null) { myTool.setToolProvider(this); myTool.activate(); // hack: update cursor if (myArea != null) { myTool.setArea(myArea); myTool.refreshCursor(); try { myTool.mouseMove(myEvent, myArea); } catch (Exception e) { showErr... | setActiveTool |
45,004 | void () { deactivateTracker(); super.deactivate(); } | deactivate |
45,005 | void () { if (myTracker == null) { super.refreshCursor(); } } | refreshCursor |
45,006 | void (int button) { if (myState == STATE_INIT) { myState = STATE_DRAG; deactivateTracker(); if (handleTracker()) { return; } if (!myArea.isTree()) { InputTool tracker = myArea.findTargetTool(myCurrentScreenX, myCurrentScreenY); if (tracker != null) { setTracker(tracker); if (tracker instanceof ResizeTracker) { myArea.s... | handleButtonDown |
45,007 | boolean () { if (!myArea.isTree() && myInputEvent.isAltDown()) { setTracker(new MarqueeTracker()); return true; } return false; } | handleTracker |
45,008 | void (int button) { myState = STATE_INIT; setTracker(null); handleMove(); // hack: update cursor } | handleButtonUp |
45,009 | void () { ActionManager actionManager = ActionManager.getInstance(); ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(myArea.getPopupPlace(), myArea.getPopupActions()); MouseEvent event = (MouseEvent)myInputEvent; popupMenu.getComponent().show(myArea.getNativeComponent(), event.getX(), event.getY()); } | handlePopup |
45,010 | void (int button) { if (button == MouseEvent.BUTTON1 && myToolProvider != null && !myArea.isTree()) { myToolProvider.startInplaceEditing(null); } } | handleDoubleClick |
45,011 | void () { if (myState == STATE_INIT) { InputTool tracker = myArea.findTargetTool(myCurrentScreenX, myCurrentScreenY); if (tracker == null) { refreshCursor(); if (ApplicationManager.getApplication().isInternal()) { myArea.setDescription(DesignerBundle.message("selection.tool.location.0.x.1", myCurrentScreenX, myCurrentS... | handleMove |
45,012 | void (@Nullable InputTool tracker) { if (myTracker != tracker) { deactivateTracker(); myTracker = tracker; refreshCursor(); if (myTracker != null) { myToolProvider.hideInspections(); myTracker.setToolProvider(myToolProvider); myTracker.setArea(myArea); myTracker.myModifiers = myModifiers; myTracker.activate(); } } } | setTracker |
45,013 | void () { if (myTracker != null) { myTracker.deactivate(); myTracker = null; if (myArea != null) { myArea.showSelection(true); } } } | deactivateTracker |
45,014 | void (KeyEvent event) { char keyChar = event.getKeyChar(); switch (keyChar) { // Zoom case '-': case '+': case '0': case '1': ZoomType type; if (keyChar == '-') { type = ZoomType.OUT; } else if (keyChar == '+') { type = ZoomType.IN; } else if (keyChar == '0') { type = ZoomType.FIT; } else { // '1' type = ZoomType.ACTUA... | handleKeyTyped |
45,015 | String () { return myDescription; } | getDescription |
45,016 | void () { eraseFeedback(); myContext = null; myOperations = null; super.deactivate(); } | deactivate |
45,017 | Cursor () { if (myState == STATE_DRAG) { return getDefaultCursor(); } return super.calculateCursor(); } | calculateCursor |
45,018 | void (int button) { if (button == MouseEvent.BUTTON1) { if (myState == STATE_INIT) { myState = STATE_DRAG; } } else { myState = STATE_INVALID; eraseFeedback(); setExecuteEnabled(false); } } | handleButtonDown |
45,019 | void (int button) { if (myState == STATE_DRAG_IN_PROGRESS) { myState = STATE_NONE; eraseFeedback(); executeCommand(); } } | handleButtonUp |
45,020 | void () { if (myState == STATE_DRAG) { myState = STATE_DRAG_IN_PROGRESS; } } | handleDragStarted |
45,021 | void () { if (myState == STATE_DRAG_IN_PROGRESS) { updateContext(); showFeedback(); updateCommand(); } } | handleDragInProgress |
45,022 | void () { for (EditOperation operation : getOperations()) { operation.showFeedback(); } myShowFeedback = true; } | showFeedback |
45,023 | void () { if (myShowFeedback) { myShowFeedback = false; for (EditOperation operation : getOperations()) { operation.eraseFeedback(); } } } | eraseFeedback |
45,024 | void () { if (myExecuteEnabled) { List<EditOperation> operations = new ArrayList<>(); for (EditOperation operation : getOperations()) { if (operation.canExecute()) { operations.add(operation); } } myToolProvider.execute(operations, DesignerBundle.message("command.tool_operation")); } } | executeCommand |
45,025 | void () { for (EditOperation operation : getOperations()) { if (operation.canExecute()) { setExecuteEnabled(true); return; } } setExecuteEnabled(false); } | updateCommand |
45,026 | void () { myContext.setArea(myArea); myContext.setInputEvent(myInputEvent); myContext.setModifiers(myModifiers); Point move = new Point(); Dimension size = new Dimension(); int moveDeltaWidth = moveDeltaWidth(); if ((myDirection & Position.WEST) != 0) { move.x += moveDeltaWidth; size.width -= moveDeltaWidth; } else if ... | updateContext |
45,027 | List<EditOperation> () { if (myOperations == null) { myContext.setComponents(new ArrayList<>(myArea.getSelection())); myOperations = new ArrayList<>(); for (RadComponent component : myContext.getComponents()) { EditOperation operation; RadComponent parent = component.getParent(); if (parent == null) { operation = myAre... | getOperations |
45,028 | void () { if (myContext != null) { updateContext(); showFeedback(); updateCommand(); } } | handleKeyEvent |
45,029 | void () { super.resetState(); mySelected = false; } | resetState |
45,030 | Cursor () { return myState == STATE_INIT || myState == STATE_DRAG ? getDefaultCursor() : super.calculateCursor(); } | calculateCursor |
45,031 | void (int button) { if (myState == STATE_INIT && (button == MouseEvent.BUTTON1 || button == MouseEvent.BUTTON3) && !myArea.isSelected(myComponent)) { performSelection(); } if (button == MouseEvent.BUTTON1) { if (myState == STATE_INIT) { myState = STATE_DRAG; } } else { if (button == MouseEvent.BUTTON3) { myState = STAT... | handleButtonDown |
45,032 | void (int button) { if (myState == STATE_DRAG) { // Control clicking on a Mac is used to simulate right clicks: do not treat this as // a selection reset (since it makes it impossible to pull up the context menu with // a multi-selection: the right click action causes the selection to be replaced // with the single ite... | handleButtonUp |
45,033 | void () { if (mySelected || myArea.isTree()) { return; } mySelected = true; performSelection(this, myComponent); } | performSelection |
45,034 | void (InputTool tool, RadComponent component) { if ((SystemInfo.isMac ? tool.myInputEvent.isMetaDown() : tool.myInputEvent.isControlDown())) { if (tool.myArea.isSelected(component)) { tool.myArea.deselect(component); } else { tool.myArea.appendSelection(component); } } else if (tool.myInputEvent.isShiftDown()) { tool.m... | performSelection |
45,035 | Cursor () { return myState == STATE_NONE ? super.getDefaultCursor() : myDragCursor; } | getDefaultCursor |
45,036 | void (int button) { if (myState == STATE_DRAG_IN_PROGRESS) { eraseFeedback(); executeCommand(); myState = STATE_NONE; } else { super.handleButtonUp(button); } } | handleButtonUp |
45,037 | void () { if (myState == STATE_DRAG_IN_PROGRESS) { updateContext(); updateTargetUnderMouse(); showFeedback(); updateCommand(); } } | handleDragInProgress |
45,038 | void () { if (myTargetOperation != null) { if (myContext.isMove()) { setExecuteEnabled(myContext.isMoveEnabled() && myTargetOperation.canExecute()); } else if (myContext.isAdd()) { setExecuteEnabled(myContext.isAddEnabled() && myTargetOperation.canExecute()); } else { setExecuteEnabled(false); } } else { setExecuteEnab... | updateCommand |
45,039 | void () { if (myContext.getComponents().isEmpty()) { return; } ContainerTargetFilter filter = new ContainerTargetFilter() { @Override public boolean preFilter(RadComponent component) { return !myContext.getComponents().contains(component); } @Override protected void updateContext(RadComponent target) { updateContextTyp... | updateTargetUnderMouse |
45,040 | boolean (RadComponent component) { return !myContext.getComponents().contains(component); } | preFilter |
45,041 | void (RadComponent target) { updateContextType(target); } | updateContext |
45,042 | void (RadComponent target) { if (myContext.getComponents().get(0).getParent() == target) { myContext.setType(OperationContext.MOVE); } else { myContext.setType(OperationContext.ADD); } } | updateContextType |
45,043 | void () { super.updateContext(); myContext.setMoveDelta(new Point(moveDeltaWidth(), moveDeltaHeight())); myContext.setSizeDelta(new Dimension()); myContext.setLocation(getLocation()); if (myContext.getComponents() == null) { List<RadComponent> components = calculateContextComponents(RadComponent.getPureSelection(myArea... | updateContext |
45,044 | List<RadComponent> (List<RadComponent> components) { RadComponent parent = null; for (RadComponent component : components) { if (parent == null) { parent = component.getParent(); } else if (parent != component.getParent()) { components = Collections.emptyList(); break; } } return components; } | calculateContextComponents |
45,045 | void () { eraseFeedback(); myContext = new OperationContext(); myTargetOperation = null; myTarget = null; super.deactivate(); } | deactivate |
45,046 | void () { eraseFeedback(); setExecuteEnabled(false); } | handleInvalidInput |
45,047 | void () { if (myState == STATE_DRAG) { myState = STATE_DRAG_IN_PROGRESS; } } | handleDragStarted |
45,048 | void () { setTarget(null, null); setExecuteEnabled(false); } | handleAreaExited |
45,049 | void () { if (myTargetOperation != null) { myTargetOperation.showFeedback(); } myShowFeedback = true; } | showFeedback |
45,050 | void () { if (myShowFeedback) { myShowFeedback = false; if (myTargetOperation != null) { myTargetOperation.eraseFeedback(); } } } | eraseFeedback |
45,051 | void () { if (myExecuteEnabled) { myToolProvider.execute(Collections.singletonList(myTargetOperation), myContext.getMessage()); } } | executeCommand |
45,052 | void () { setExecuteEnabled(myTargetOperation != null && myTargetOperation.canExecute()); } | updateCommand |
45,053 | void () { myContext.setArea(myArea); myContext.setInputEvent(myInputEvent); myContext.setModifiers(myInputEvent.getModifiers()); } | updateContext |
45,054 | void (@Nullable RadComponent target, @Nullable ContainerTargetFilter filter) { if (target != myTarget) { if (myTargetOperation != null) { eraseFeedback(); } myTarget = target; myTargetOperation = filter == null ? null : filter.getOperation(); } } | setTarget |
45,055 | void () { if (myContext != null) { updateContext(); showFeedback(); updateCommand(); } } | handleKeyEvent |
45,056 | EditOperation () { return myOperation; } | getOperation |
45,057 | boolean (RadComponent component) { return true; } | preFilter |
45,058 | boolean (RadComponent target) { updateContext(target); if (myTarget == target && myOperation != null) { return true; } RadLayout layout = target.getLayout(); if (layout != null) { myContext.setContainer(target); myOperation = layout.processChildOperation(myContext); myContext.setContainer(null); } return myOperation !=... | resultFilter |
45,059 | void (RadComponent target) { } | updateContext |
45,060 | void () { super.activate(); myContext.setType(OperationContext.PASTE); try { myContext.setComponents(myFactory.create()); } catch (Throwable e) { myToolProvider.loadDefaultTool(); } } | activate |
45,061 | void () { myTargetOperation.setComponents(myContext.getComponents()); } | updateTarget |
45,062 | void (int direction) { myDirection = direction; int yDirection = myDirection & Position.EAST_WEST; if (yDirection == Position.WEST) { myXSeparator = 0; } else if (yDirection == Position.EAST) { myXSeparator = 1; } else { myXSeparator = 0.5; } int xDirection = myDirection & Position.NORTH_SOUTH; if (xDirection == Positi... | setDirection |
45,063 | DirectionResizePoint (double xSeparator, double ySeparator) { myXSeparator = xSeparator; myYSeparator = ySeparator; return this; } | move |
45,064 | int () { return myDirection; } | getDirection |
45,065 | Object () { return myType; } | getType |
45,066 | InputTool (RadComponent component) { return new ResizeTracker(myDirection, myType, myDescription); } | createTool |
45,067 | Point (DecorationLayer layer, RadComponent component) { Rectangle bounds = getBounds(layer, component); int size = (getSize() + 1) / 2; int x = bounds.x + (int)(bounds.width * myXSeparator) - size; int y = bounds.y + (int)(bounds.height * myYSeparator) - size; return new Point(x, y); } | getLocation |
45,068 | Rectangle (DecorationLayer layer, RadComponent component) { return component.getBounds(layer); } | getBounds |
45,069 | InputTool (DecorationLayer layer, RadComponent component, int x, int y) { return null; } | findTargetTool |
45,070 | Object () { return null; } | getType |
45,071 | InputTool (RadComponent component) { return null; } | createTool |
45,072 | Point (DecorationLayer layer, RadComponent component) { return null; } | getLocation |
45,073 | InputTool (DecorationLayer layer, RadComponent component, int x, int y) { Point location = getLocation(layer, component); Rectangle bounds = new Rectangle(location.x, location.y, getSize(), getSize()); int neighborhood = getNeighborhoodSize(); if (neighborhood > 0) { bounds.grow(neighborhood, neighborhood); } if (bound... | findTargetTool |
45,074 | void (DecorationLayer layer, Graphics2D g, RadComponent component) { Point location = getLocation(layer, component); g.setColor(myColor); g.fillRect(location.x, location.y, getSize(), getSize()); g.setColor(myBorder); g.drawRect(location.x, location.y, getSize(), getSize()); } | paint |
45,075 | int () { return DEFAULT_SIZE; } | getSize |
45,076 | int () { return 0; } | getNeighborhoodSize |
45,077 | void () { myPoints.clear(); } | clear |
45,078 | void (ResizePoint point) { myPoints.add(point); } | addPoint |
45,079 | InputTool (DecorationLayer layer, RadComponent component, int x, int y) { for (ResizePoint point : myPoints) { if (visible(component, point)) { InputTool tracker = point.findTargetTool(layer, component, x, y); if (tracker != null) { return tracker; } } } return super.findTargetTool(layer, component, x, y); } | findTargetTool |
45,080 | void (DecorationLayer layer, Graphics2D g, RadComponent component) { super.decorate(layer, g, component); for (ResizePoint point : myPoints) { if (visible(component, point)) { point.decorate(layer, g, component); } } } | decorate |
45,081 | boolean (RadComponent component, ResizePoint point) { return true; } | visible |
45,082 | InputTool (DecorationLayer layer, RadComponent component, int x, int y) { Rectangle bounds = getBounds(layer, component); int lineWidth = Math.max(myLineWidth, 2); Rectangle top = new Rectangle(bounds.x, bounds.y, bounds.width, lineWidth); Rectangle bottom = new Rectangle(bounds.x, bounds.y + bounds.height - lineWidth,... | findTargetTool |
45,083 | void (DecorationLayer layer, Graphics2D g, RadComponent component) { g.setColor(myColor); if (myStroke != null) { g.setStroke(myStroke); } Rectangle bounds = getBounds(layer, component); g.drawRect(bounds.x, bounds.y, bounds.width, bounds.height); } | paint |
45,084 | Rectangle (DecorationLayer layer, RadComponent component) { return component.getBounds(layer); } | getBounds |
45,085 | void (Graphics g) { if (myCross) { int size = getWidth(); int size2 = (size - 3) / 2; AlphaFeedback.fillRect2(g, 0, size2, size, 3, myColor); AlphaFeedback.fillRect2(g, size2, 0, 3, size, myColor); g.drawLine(0, size2 + 1, size, size2 + 1); g.drawLine(size2 + 1, 0, size2 + 1, size); } else { super.paintLines(g); } } | paintLines |
45,086 | void (int xCenter, int yCenter, int size) { myCross = true; setBounds(xCenter - size - 1, yCenter - size - 1, 2 * size + 3, 2 * size + 3); setVisible(true); } | cross |
45,087 | void (int x, int y, int width) { myCross = false; super.horizontal(x, y, width); } | horizontal |
45,088 | void (int x, int y, int height) { myCross = false; super.vertical(x, y, height); } | vertical |
45,089 | void (Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D)g; g2d.setColor(myColor); g2d.setComposite(myComposite1); paintOther1(g2d); g2d.setColor(myBorderColor); g2d.setComposite(myComposite2); paintOther2(g2d); } | paintComponent |
45,090 | void (Graphics2D g2d) { g2d.fillRect(0, 0, getWidth(), getHeight()); } | paintOther1 |
45,091 | void (Graphics2D g2d) { g2d.drawRect(0, 0, getWidth() - 1, getHeight() - 1); } | paintOther2 |
45,092 | void (Graphics g, int x, int y, int width, int height, Color color) { fillRect(g, x, y, width, height, color, myComposite1); } | fillRect1 |
45,093 | void (Graphics g, int x, int y, int width, int height, Color color) { fillRect(g, x, y, width, height, color, myComposite2); } | fillRect2 |
45,094 | void (Graphics g, int x, int y, int width, int height, Color color, Composite composite) { Graphics2D g2d = (Graphics2D)g; Composite oldComposite = g2d.getComposite(); Color oldColor = g.getColor(); g2d.setColor(color); g2d.setComposite(composite); g2d.fillRect(x, y, width, height); g2d.setComposite(oldComposite); g2d.... | fillRect |
45,095 | void (Graphics g, Dimension size) { for (int i = 0; i < SIZE; i++) { g.drawLine(0, i + SIZE, size.width, i + SIZE); g.drawLine(i, 0, i, FULL_SIZE); g.drawLine(size.width - i - 1, 0, size.width - i - 1, FULL_SIZE); } } | paintHorizontal |
45,096 | void (Graphics g, Dimension size) { for (int i = 0; i < SIZE; i++) { g.drawLine(i + SIZE, 0, i + SIZE, size.height); g.drawLine(0, i, FULL_SIZE, i); g.drawLine(0, size.height - i - 1, FULL_SIZE, size.height - i - 1); } } | paintVertical |
45,097 | void (Component c, Graphics g, int x, int y, int width, int height) { Color oldColor = g.getColor(); g.setColor(myColor); g.drawRect(x, y, width - 1, height - 1); g.setColor(oldColor); } | paintBorder |
45,098 | void (Graphics g) { Graphics2D g2d = (Graphics2D)g; Stroke oldStroke = g2d.getStroke(); g2d.setStroke(STROKE); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); Dimension size = getSize(); g.drawRoundRect(0, 0, size.width - 1, size.height - 1, myRadius, myRadius); g2d.setStroke(o... | paintFeedback |
45,099 | void (Graphics g) { super.paintComponent(g); g.setColor(myColor); paintFeedback(g); } | paintComponent |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.