• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CompoundPainter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jdesktop.swingx.painter.CompoundPainter的典型用法代码示例。如果您正苦于以下问题:Java CompoundPainter类的具体用法?Java CompoundPainter怎么用?Java CompoundPainter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: createGlossPainterDemos

import org.jdesktop.swingx.painter.CompoundPainter; //导入依赖的package包/类
private MutableTreeNode createGlossPainterDemos() {
    DefaultMutableTreeNode node = createInfoNode("Gloss Painter Demos",
            null);

    RectanglePainter rp = new RectanglePainter(20, 20, 20,
            20, 20, 20);
    rp.setFillPaint(Color.RED);
    rp.setBorderPaint(Color.RED.darker());
    rp.setStyle(RectanglePainter.Style.BOTH);
    rp.setBorderWidth(5);
    rp.setAntialiasing(true);
    CompoundPainter<Object> cp = new CompoundPainter<Object>(rp, new GlossPainter());
    node.add(createInfoNode("Gloss on top of rectangle", cp));

    rp = new RectanglePainter(20, 20, 20, 20, 20, 20, true,
            Color.RED, 5f, Color.RED.darker());
    rp.setAntialiasing(true);
    cp = new CompoundPainter<Object>(rp, new GlossPainter(GlossPosition.BOTTOM));
    node.add(createInfoNode("Gloss on bottom of rectangle", cp));

    return node;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:23,代码来源:PainterDemo.java


示例2: rebuildMainMapOverlay

import org.jdesktop.swingx.painter.CompoundPainter; //导入依赖的package包/类
@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);
}
 
开发者ID:DSheirer,项目名称:sdrtrunk,代码行数:13,代码来源:JXMapKit.java


示例3: savePainterToImage

import org.jdesktop.swingx.painter.CompoundPainter; //导入依赖的package包/类
public static void savePainterToImage(JComponent testPanel, CompoundPainter compoundPainter, File file) throws IOException {
    BufferedImage img = new BufferedImage(testPanel.getWidth(),testPanel.getHeight(),
            BufferedImage.TYPE_INT_ARGB);
    Graphics2D g = img.createGraphics();
    setBGP(testPanel,compoundPainter);
    testPanel.paint(g);
    ImageIO.write(img,"png",file);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:9,代码来源:PainterUtil.java


示例4: interactiveRestoreDefaultForegroundPainter

import org.jdesktop.swingx.painter.CompoundPainter; //导入依赖的package包/类
/**
 * Issue #??-swingx: default foreground painter not guaranteed after change.
 *
 * JXLabel restore default foreground painter.
 * Sequence: 
 *   compose the default with a transparent overlay
 *   try to reset to default
 *   try to compose the overlay again.
 */
public void interactiveRestoreDefaultForegroundPainter() {
    JComponent box = Box.createVerticalBox();
    final JXLabel foreground = new JXLabel(
            "setup: compound - default and overlay ");
    ShapePainter shapePainter = new ShapePainter();
    final AlphaPainter<?> alpha = new AlphaPainter<Object>();
    alpha.setAlpha(0.2f);
    alpha.setPainters(shapePainter);
    CompoundPainter<?> compound = new CompoundPainter<Object>(foreground
            .getForegroundPainter(), alpha);
    foreground.setForegroundPainter(compound);
    box.add(foreground);
    Action action = new AbstractActionExt("reset default foreground") {
        boolean reset;
        public void actionPerformed(ActionEvent e) {
            if (reset) {
                CompoundPainter<?> painter = new CompoundPainter<Object>(alpha, foreground.getForegroundPainter());
                foreground.setForegroundPainter(painter);
            } else {
              // try to reset to default
                foreground.setForegroundPainter(null);
            }
            reset = !reset;

        }

    };
    JXFrame frame = wrapInFrame(box, "foreground painters");
    addAction(frame, action);
    frame.pack();
    frame.setVisible(true);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:42,代码来源:JXLabelVisualCheck.java


示例5: initialize

import org.jdesktop.swingx.painter.CompoundPainter; //导入依赖的package包/类
public void initialize(NodeManager nodeManager, Map<String, Car> allCars) {
	this.nodeManager = nodeManager;

	mapViewer = new JXMapViewer();

	TileFactoryInfo info = new OSMTileFactoryInfo();
	DefaultTileFactory tileFactory = new DefaultTileFactory(info);
	tileFactory.setThreadPoolSize(8);

	mapViewer.setTileFactory(tileFactory);

	mapViewer.setAddressLocation(new GeoPosition(48.14650327493638,
			16.329095363616943));

	mapViewer.setZoom(3);

	CarPainter carPainter = new CarPainter();
	GraphPainter graphPainter = new GraphPainter();
	ClusterPainter clusterPainter = new ClusterPainter();

	CompoundPainter<JXMapViewer> painter = new CompoundPainter<JXMapViewer>();
	painter.addPainter(carPainter);
	if (MapsRacer.DEBUG) {
		painter.addPainter(graphPainter);
		painter.addPainter(clusterPainter);
	}

	carPainter.initialize(allCars);
	graphPainter.initialize(nodeManager.getStreets());
	clusterPainter.initialize(nodeManager.getClusters());

	mapViewer.setOverlayPainter(painter);

	if (MapsRacer.DEBUG) {
		MouseInputListener mouseListener = new PanMouseInputListener(
				mapViewer);
		mapViewer.addMouseListener(mouseListener);
		mapViewer.addMouseMotionListener(mouseListener);
	}
}
 
开发者ID:TomTasche,项目名称:mapsracer,代码行数:41,代码来源:MapManager.java


示例6: rebuildMainMapOverlay

import org.jdesktop.swingx.painter.CompoundPainter; //导入依赖的package包/类
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);
}
 
开发者ID:3dcitydb,项目名称:swingx-ws,代码行数:15,代码来源:JXMapKit.java


示例7: createPinstripePainterDemos

import org.jdesktop.swingx.painter.CompoundPainter; //导入依赖的package包/类
private MutableTreeNode createPinstripePainterDemos() {
    DefaultMutableTreeNode node = createInfoNode("Pinstripe Painter Demos", null);
    MattePainter black = new MattePainter(Color.BLACK);
    
    PinstripePainter pp = new PinstripePainter(Color.WHITE, 45, 1, 10);
    CompoundPainter<Object> cp = new CompoundPainter<Object>(black, pp);
    node.add(createInfoNode("45deg white pinstripe on black", cp));
    
    pp = new PinstripePainter(Color.WHITE, 0, 1, 10);
    pp.setAntialiasing(true);
    cp = new CompoundPainter<Object>(black, pp);
    node.add(createInfoNode("vertical white pinstripe on black", cp));
    
    pp = new PinstripePainter(Color.WHITE, 90, 1, 10);
    pp.setAntialiasing(true);
    cp = new CompoundPainter<Object>(black, pp);
    node.add(createInfoNode("horizontal white pinstripe on black", cp));
    
    pp = new PinstripePainter(Color.WHITE, 45, 3, 10);
    pp.setAntialiasing(true);
    cp = new CompoundPainter<Object>(black, pp);
    node.add(createInfoNode("3px wide white pinstripe on black", cp));
    
    pp = new PinstripePainter(Color.WHITE, 45, 10, 2);
    pp.setAntialiasing(true);
    cp = new CompoundPainter<Object>(black, pp);
    node.add(createInfoNode("10px wide pinstripe w/ 2px spacing on black", cp));
    
    pp = new PinstripePainter(Color.WHITE, 45, 3, 15);
    pp.setAntialiasing(true);
    pp.setPaint(
            new GradientPaint(new Point(0, 0), Color.WHITE, new Point(10, 10), Color.BLACK));
    cp = new CompoundPainter<Object>(black, pp);
    node.add(createInfoNode("pinstripe w/ 10px gradient", cp));
    
    pp = new PinstripePainter(Color.WHITE, 45, 3, 15);
    pp.setAntialiasing(true);
    pp.setPaint(
            new GradientPaint(new Point(0, 0), Color.WHITE, new Point(200, 200), Color.BLACK));
    cp = new CompoundPainter<Object>(black, pp);
    node.add(createInfoNode("pinstripe w/ 200px gradient", cp));
    
    return node;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:45,代码来源:PainterDemo.java


示例8: IntroPanelDemo

import org.jdesktop.swingx.painter.CompoundPainter; //导入依赖的package包/类
public IntroPanelDemo() {
    setName("introPanel");
    
    // <snip> ImagePainters for intro
    introImagePainter = new ImagePainter();
    introImagePainter.setFillHorizontal(true);
    introImagePainter.setVerticalAlignment(VerticalAlignment.TOP);
    
    textImagePainter = new SlidingPainter();
    textImagePainter.setVisible(false);
    textImagePainter.setHorizontalAlignment(HorizontalAlignment.LEFT);
    textImagePainter.setVerticalAlignment(VerticalAlignment.TOP);
    
    setBackgroundPainter(new CompoundPainter<Object>(introImagePainter, textImagePainter));
    // </snip>
    

    Application.getInstance().getContext().getResourceMap(getClass()).injectComponents(this);

    bind();
    
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:23,代码来源:IntroPanelDemo.java


示例9: main

import org.jdesktop.swingx.painter.CompoundPainter; //导入依赖的package包/类
/**
 * @param args the program args (ignored)
 */
public static <T> void main(String[] args)
{
	JXMapViewer mapViewer = new JXMapViewer();

	// Create a TileFactoryInfo for OpenStreetMap
	TileFactoryInfo info = new OSMTileFactoryInfo();
	DefaultTileFactory tileFactory = new DefaultTileFactory(info);
	tileFactory.setThreadPoolSize(8);
	mapViewer.setTileFactory(tileFactory);

	GeoPosition frankfurt = new GeoPosition(50,  7, 0, 8, 41, 0);
	GeoPosition wiesbaden = new GeoPosition(50,  5, 0, 8, 14, 0);
	GeoPosition mainz     = new GeoPosition(50,  0, 0, 8, 16, 0);
	GeoPosition darmstadt = new GeoPosition(49, 52, 0, 8, 39, 0);
	GeoPosition offenbach = new GeoPosition(50,  6, 0, 8, 46, 0);

	// Set the focus
	mapViewer.setZoom(10);
	mapViewer.setAddressLocation(frankfurt);

	// Create a track from the geo-positions
	List<GeoPosition> track = Arrays.asList(frankfurt, wiesbaden, mainz, darmstadt, offenbach);
	RoutePainter routePainter = new RoutePainter(track);

	// Create waypoints from the geo-positions
	Set<Waypoint> waypoints = new HashSet<Waypoint>(Arrays.asList(
			new DefaultWaypoint(frankfurt),
			new DefaultWaypoint(wiesbaden),
			new DefaultWaypoint(mainz),
			new DefaultWaypoint(darmstadt),
			new DefaultWaypoint(offenbach)));

	// Create a waypoint painter that takes all the waypoints
	WaypointPainter<Waypoint> waypointPainter = new WaypointPainter<Waypoint>();
	waypointPainter.setWaypoints(waypoints);

	// Create a compound painter that uses both the route-painter and the waypoint-painter
	List<Painter<JXMapViewer>> painters = new ArrayList<Painter<JXMapViewer>>();
	painters.add(routePainter);
	painters.add(waypointPainter);

	CompoundPainter<JXMapViewer> painter = new CompoundPainter<JXMapViewer>(painters);
	mapViewer.setOverlayPainter(painter);

	// Display the viewer in a JFrame
	JFrame frame = new JFrame("JXMapviewer2 Example 2");
	frame.getContentPane().add(mapViewer);
	frame.setSize(800, 600);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setVisible(true);
}
 
开发者ID:klamann,项目名称:maps4cim,代码行数:55,代码来源:Sample2.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AppsInfo类代码示例发布时间:2022-05-22
下一篇:
Java BasicMLData类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap