public void update(){ int w = image.getWidth(); int h = image.getHeight(); float wr = (float) cam.getWidth() / image.getWidth(); float hr = (float) cam.getHeight() / image.getHeight(); scene.updateGeometricState(); for (int y = 0; y < h; y++){ for (int x = 0; x < w; x++){ Vector2f v = new Vector2f(x * wr,y * hr); Vector3f pos = cam.getWorldCoordinates(v, 0.0f); Vector3f dir = cam.getWorldCoordinates(v, 0.3f); dir.subtractLocal(pos).normalizeLocal(); Ray r = new Ray(pos, dir); results.clear(); scene.collideWith(r, results); if (results.size() > 0){ image.setRGB(x, h - y - 1, 0xFFFFFFFF); }else{ image.setRGB(x, h - y - 1, 0xFF000000); } } } label.repaint(); }
/** * Set the line color items to show the given color choice * * @param color current color */ private void setLineColorItems(Color color) { if (color != null) { lineColor = color; lineColorIcon.setColor(color); lineColorLabel.repaint(); } }
/** * Set the fill color items to show the given color choice * * @param color current color */ private void setFillColorItems(Color color) { if (color != null) { fillColor = color; fillColorIcon.setColor(color); fillColorLabel.repaint(); } }
@Override public void actionPerformed(ActionEvent e) { if (icons == null) { icons = new ImageIcon[8]; for (int i = 0; i < 8; i++) { icons[i] = ImageUtilities.loadImageIcon("org/openide/awt/resources/quicksearch/progress_" + i + ".png", false); //NOI18N } } jLabel.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 6)); jLabel.setIcon(icons[index]); //mac os x jLabel.repaint(); index = (index + 1) % 8; } });
final JLabel label = new JLabel("some label with a nice text"); label.setBackground(Color.YELLOW); MouseAdapter adapter = new MouseAdapter() { /** * @inherited <p> */ @Override public void mouseEntered(MouseEvent e) { label.setOpaque(true); label.repaint(); } /** * @inherited <p> */ @Override public void mouseExited(MouseEvent e) { label.setOpaque(false); label.repaint(); } }; label.addMouseListener(adapter);
private void myMouseDragged(MouseEvent e) { if (getActiveSide() == ALL) { if (SX.isNull(lastDrag)) { dragStart = e; } dragCurrent = e; content.repaint(); } else { dragSelection(e); } lastDrag = e; }
content.repaint(); if (masking) { mask = new Element(rect);
public JComponent initUi() { myValueLabel = new JLabel() { @Override public String getText() { return getCurrentText(); } }; setDefaultForeground(); setFocusable(true); setBorder(createUnfocusedBorder()); setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); add(myValueLabel); add(Box.createHorizontalStrut(GAP_BEFORE_ARROW)); add(new JLabel(AllIcons.Ide.Statusbar_arrows)); installChangeListener(() -> { myValueLabel.revalidate(); myValueLabel.repaint(); }); showPopupMenuOnClick(); showPopupMenuFromKeyboard(); indicateHovering(); indicateFocusing(); return this; }
@Override public void repaint(int x, int y, int width, int height) { if (!dontIgnoreRepaint) { return; } super.repaint(x, y, width, height); }
@Override public void repaint(long tm) { if (repaintable) { super.repaint(tm); } }
@Override public void repaint() { if (!dontIgnoreRepaint) { return; } super.repaint(); }
@Override public void repaint(long tm, int x, int y, int width, int height) { if (!dontIgnoreRepaint) { return; } super.repaint(tm, x, y, width, height); }
public void setTitleColor(Color color) { titleLabel.setForeground(color); titleLabel.validate(); titleLabel.repaint(); }
@Override public void mouseEntered(MouseEvent e) { clearIcon.setHover(true); clearIconLabel.repaint(); }
@Override public void mouseExited(MouseEvent e) { clearIcon.setHover(false); clearIconLabel.repaint(); }
private void updatePreviewLabel() { SimpleDateFormat dateFormat = new SimpleDateFormat( getDateFormatString() +" "+getTimeFormatString()); previewLabel.setText(dateFormat.format(exampleDate)); previewLabel.repaint(); }
@Override public void doRefresh() { ColorTable colorTable = getValue(); fillImage(colorTable); picLabel.setIcon(new ImageIcon(image)); picLabel.repaint(); }
public void setStructure1(Structure structure){ this.structure1 = structure; if ( structure != null) { setAtoms(structure1,panel1); label1.setText(structure.getPDBCode()); label1.repaint(); } } public void setStructure2(Structure structure){
public void highlightLabel(String searchText) { LabelUI ui = getIconLabel().getUI(); if (ui instanceof HighlightingLabelUI) { ((HighlightingLabelUI)ui).setHighlightText(searchText); getIconLabel().repaint(); } }
private void updateWithGenericInfo() { String title = SparkManager.getUserManager().getUserNicknameFromJID(jid); titleLabel.setText(title); avatarLabel.setIcon(SparkRes.getImageIcon(SparkRes.DEFAULT_AVATAR_64x64_IMAGE)); avatarLabel.invalidate(); avatarLabel.validate(); avatarLabel.repaint(); invalidate(); validate(); repaint(); }