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

Java PreviewProperty类代码示例

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

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



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

示例1: renderProcessing

import org.gephi.preview.api.PreviewProperty; //导入依赖的package包/类
@Override
public void renderProcessing(Item item, ProcessingTarget target, PreviewProperties properties) {
    Float x = item.getData(NodeItem.X);
    Float y = item.getData(NodeItem.Y);
    Float size = item.getData(NodeItem.SIZE);
    Color color = item.getData(NodeItem.COLOR);
    int alpha = (int) ((properties.getFloatValue(PreviewProperty.NODE_OPACITY) / 100f) * 255f);
    if (alpha > 255) {
        alpha = 255;
    }
    PGraphics graphics = target.getGraphics();
    graphics.fill(color.getRed(), color.getGreen(), color.getBlue(), alpha);
    if (size > 21) {
        logger.print(size);
        Color stC = color.darker().darker().darker();
        graphics.stroke(stC.getRed(), stC.getGreen(), stC.getBlue(), alpha);
        graphics.strokeWeight(3f);
        graphics.ellipse(x, y, size, size);
    } else {
        graphics.stroke(color.getRed(), color.getGreen(), color.getBlue(), alpha);
        graphics.strokeWeight(1f);
        graphics.ellipse(x, y, size, size);
    }
}
 
开发者ID:nolanlab,项目名称:vortex,代码行数:25,代码来源:frmScFDL.java


示例2: jButton4ActionPerformed

import org.gephi.preview.api.PreviewProperty; //导入依赖的package包/类
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
    previewController = Lookup.getDefault().lookup(PreviewController.class
    );
    PreviewModel previewModel = previewController.getModel();

    //int opacity = Integer.parseInt(JOptionPane.showInputDialog("Edge opacity [0-100]", previewModel.getProperties().getValue(PreviewProperty.EDGE_OPACITY)).toString());
    //opacity = Math.max(0, Math.max(100, opacity));
    //previewModel.getProperties().putValue(PreviewProperty.EDGE_OPACITY, opacity);
    Color col = ((EdgeColor) previewModel.getProperties().getValue(PreviewProperty.EDGE_COLOR)).getCustomColor();

    JColorChooser jc = new JColorChooser(col);
    JOptionPane.showInputDialog(jc);
    jc.getColor();
    previewModel.getProperties().putValue(PreviewProperty.EDGE_COLOR, new EdgeColor(jc.getColor()));

}
 
开发者ID:nolanlab,项目名称:vortex,代码行数:17,代码来源:frmModuleMap.java


示例3: exportData

import org.gephi.preview.api.PreviewProperty; //导入依赖的package包/类
private void exportData() throws IOException {
	PreviewController controller = Lookup.getDefault().lookup(
			PreviewController.class);
	PreviewProperties props = controller.getModel(workspace)
			.getProperties();

	props.putValue(PreviewProperty.VISIBILITY_RATIO, 1.0);
	props.putValue("width", width);
	props.putValue("height", height);
	props.putValue(PreviewProperty.MARGIN, margin);
	// props.putValue(PreviewProperty.EDGE_CURVED, false);

	controller.refreshPreview(workspace);

	ProcessingTarget target = (ProcessingTarget) controller
			.getRenderTarget(RenderTarget.PROCESSING_TARGET, workspace);

	target.refresh();

	PGraphicsJava2D pg2 = (PGraphicsJava2D) target.getGraphics();
	BufferedImage img = new BufferedImage(width, height,
			BufferedImage.TYPE_INT_RGB);
	img.setRGB(0, 0, width, height, pg2.pixels, 0, width);
	ImageIO.write(img, "jpg", outputStream);

	outputStream.close();
	props.removeSimpleValue(PreviewProperty.VISIBILITY_RATIO);
	props.removeSimpleValue("width");
	props.removeSimpleValue("height");
	props.removeSimpleValue(PreviewProperty.MARGIN);
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:32,代码来源:JPEGExporter.java


示例4: paintScale

import org.gephi.preview.api.PreviewProperty; //导入依赖的package包/类
private void paintScale(Graphics g) {
    if (scaleImg != null) {
        Graphics2D g2 = (Graphics2D) g;
        previewController = Lookup.getDefault().lookup(PreviewController.class);
        PreviewModel previewModel = previewController.getModel();
        g2.setPaint(previewModel.getProperties().getColorValue(PreviewProperty.BACKGROUND_COLOR));
        g2.fillRect(0, 0, this.getWidth(), this.getHeight());
        g2.drawImage(scaleImg, null, 0, -10);
    }
}
 
开发者ID:nolanlab,项目名称:vortex,代码行数:11,代码来源:frmMST.java


示例5: refresh

import org.gephi.preview.api.PreviewProperty; //导入依赖的package包/类
/**
 * Refreshes the preview using the current graph from the preview controller.
 */
public void refresh(PreviewModel model, RenderTarget target) {
	this.model = model;
	this.target = target;
	// updates fonts
	//fontMap.clear(); Don't clear to prevent PFont memory leak from Processing library.
	if (model != null) {
		background = model.getProperties().getColorValue(PreviewProperty.BACKGROUND_COLOR);
	}

	// redraws the applet
	initAppletLayout();
	redraw();
}
 
开发者ID:nullbox,项目名称:Data-and-Information-Visualization-Project,代码行数:17,代码来源:CustomApplet.java


示例6: getProperties

import org.gephi.preview.api.PreviewProperty; //导入依赖的package包/类
public PreviewProperty[] getProperties() {
    return new PreviewProperty[0];
}
 
开发者ID:nolanlab,项目名称:vortex,代码行数:4,代码来源:MyPreviewMouseResponsiveRenderer.java


示例7: jCheckBox1ActionPerformed

import org.gephi.preview.api.PreviewProperty; //导入依赖的package包/类
private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
    previewController = Lookup.getDefault().lookup(PreviewController.class);
    PreviewModel previewModel = previewController.getModel();
    previewModel.getProperties().putValue(PreviewProperty.SHOW_EDGES, !jCheckBox1.isSelected());
    lstParamValueChanged(null);
}
 
开发者ID:nolanlab,项目名称:vortex,代码行数:7,代码来源:frmFlowMap.java


示例8: setMoving

import org.gephi.preview.api.PreviewProperty; //导入依赖的package包/类
public void setMoving(boolean moving) {
	if (model != null) {
		model.getProperties().putValue(PreviewProperty.MOVING, moving);
	}
}
 
开发者ID:nullbox,项目名称:Data-and-Information-Visualization-Project,代码行数:6,代码来源:CustomApplet.java


示例9: renderShapeProcessing

import org.gephi.preview.api.PreviewProperty; //导入依赖的package包/类
public void renderShapeProcessing(Item item, ProcessingTarget target, PreviewProperties properties, short type) {

		Float x = item.getData(NodeItem.X);
		Float y = item.getData(NodeItem.Y);
		Float size = item.getData(NodeItem.SIZE);

		Color color = item.getData(NodeItem.COLOR);
		Color borderColor = ((DependantColor) properties.getValue(PreviewProperty.NODE_BORDER_COLOR)).getColor(color);
		float borderSize = properties.getFloatValue(PreviewProperty.NODE_BORDER_WIDTH);
		int alpha = (int) ((properties.getFloatValue(PreviewProperty.NODE_OPACITY) / 100f) * 255f);
		if (alpha > 255) {
			alpha = 255;
		}
		if (target != null) {
			PGraphics graphics = target.getGraphics();

			if (borderSize > 0) {
				graphics.stroke(borderColor.getRed(), borderColor.getGreen(), borderColor.getBlue(), alpha);
				graphics.strokeWeight(borderSize);
			} else {
				graphics.noStroke();
			}
			graphics.fill(color.getRed(), color.getGreen(), color.getBlue(), alpha);

			// x and y describe the center 
			switch (type) {
			case Node.TYPE_SERVER:
				graphics.triangle(x + size / 2, y + size * SQRT_OF_12, x - size / 2, y + size * SQRT_OF_12, x, y - 2 * size * SQRT_OF_12);
				break;
			case Node.TYPE_WORKSTATION:
				graphics.rect(x, y, size, size);
				break;
			case Node.TYPE_ADMINISTRATOR:
				x -= size / 2;
				y -= size / 2;
				graphics.beginShape();
				{
					graphics.vertex(x, y + size / 2);
					graphics.vertex(x + size / 3, y + size);
					graphics.vertex(x + size / 3 * 2, y + size);
					graphics.vertex(x + size, y + size / 2);
					graphics.vertex(x + size / 3 * 2, y);
					graphics.vertex(x + size / 3, y);
				}
				graphics.endShape();
				break;
			default:
			}

		}
	}
 
开发者ID:nullbox,项目名称:Data-and-Information-Visualization-Project,代码行数:52,代码来源:MouseRenderer.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java DescendableLinkedList类代码示例发布时间:2022-05-22
下一篇:
Java PBEKeyEncryptionMethodGenerator类代码示例发布时间: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