/** * {@inheritDoc} */ @Override protected CompoundPainter createTestingPainter() { return new CompoundPainter(); }
@SuppressWarnings("unchecked") private void rebuildMainMapOverlay() { CompoundPainter<JXMapViewer> cp = new CompoundPainter<JXMapViewer>(); cp.setCacheable(false); /* * List<Painter> ptrs = new ArrayList<Painter>(); if(isDataProviderCreditShown()) { * ptrs.add(dataProviderCreditPainter); } if(isAddressLocationShown()) { ptrs.add(addressLocationPainter); } */ cp.setPainters(dataProviderCreditPainter, addressLocationPainter); mainMap.setOverlayPainter(cp); }
private void rebuildMainMapOverlay() { CompoundPainter cp = new CompoundPainter(); cp.setCacheable(false); /* List<Painter> ptrs = new ArrayList<Painter>(); if(isDataProviderCreditShown()) { ptrs.add(dataProviderCreditPainter); } if(isAddressLocationShown()) { ptrs.add(addressLocationPainter); }*/ cp.setPainters(dataProviderCreditPainter, addressLocationPainter); mainMap.setOverlayPainter(cp); }
private void setupPainters() { //Tom doesnt like the gloss :) // GlossPainter gloss = new GlossPainter(new Color(1.0f, 1.0f, 1.0f, 0.2f), // GlossPainter.GlossPosition.TOP); PinstripePainter stripes = new PinstripePainter(); stripes.setPaint(new Color(1.0f, 1.0f, 1.0f, 0.17f)); stripes.setSpacing(5.0); MattePainter matte = new MattePainter(COLOR_BASE); setBackgroundPainter(new CompoundPainter(matte, stripes)); }
/** * Gets the compound painter. * * @param color * the color * @param position * the position * @param angle * the angle * @return the compound painter */ @SuppressWarnings("rawtypes") public static CompoundPainter getCompoundPainter(final Color color, final GlossPainter.GlossPosition position, final double angle) { final MattePainter mp = new MattePainter(color); final GlossPainter gp = new GlossPainter(color, position); final PinstripePainter pp = new PinstripePainter(color, angle); final CompoundPainter compoundPainter = new CompoundPainter(mp, pp, gp); return compoundPainter; }
/** * Gets a CompoundPainter object. * * @param matte * the matte color * @param gloss * the gloss color * @param position * the position * @param angle * the angle * @param pinstripe * the pinstripe painter * @return the CompoundPainter object. */ @SuppressWarnings("rawtypes") public static CompoundPainter getCompoundPainter(final Color matte, final Color gloss, final GlossPainter.GlossPosition position, final double angle, final Color pinstripe) { final MattePainter mp = new MattePainter(matte); final GlossPainter gp = new GlossPainter(gloss, position); final PinstripePainter pp = new PinstripePainter(pinstripe, angle); final CompoundPainter compoundPainter = new CompoundPainter(mp, pp, gp); return compoundPainter; }
/** * Issue #497-swingx: setPainters can't cope with null. * */ @Test public void testSetNullPainters() { CompoundPainter<Object> painter = new CompoundPainter<Object>(); // changed to cast to Painter, since uncasted it is equivalent to // Painter[], which is checked in the next test painter.setPainters((Painter<?>) null); }
/** * Issue #497-swingx: setPainters can't cope with null. * */ @Test public void testSetEmptyPainters() { CompoundPainter<Object> painter = new CompoundPainter<Object>(); // okay painter.setPainters(); // fails painter.setPainters((Painter[]) null); }
@Override public void mouseEntered(MouseEvent e) { homeButton.setBackgroundPainter(new org.jdesktop.swingx.painter.CompoundPainter<JXButton>(new MattePainter((Color) UIManager.getLookAndFeelDefaults().get("Button.light")), new GlossPainter())); }
legendMainPanel.setAlpha(.8f); legendMainPanel.setPreferredSize(LEGEND_DIMENSION); legendMainPanel.setBackgroundPainter(new CompoundPainter(matte, stripes)); legendMainPanel.add(legendTitlePanel); legendMainPanel.add(legendActionPanel);