- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 JGraphx 中,可以绘制自定义顶点。我定义了自定义对象并将其用作顶点的值。要将图表保存并加载为 xml 文件,自定义对象已注册如下:
mxCodecRegistry.addPackage(the path of the custom object);
mxCodecRegistry.register(new mxObjectCodec(new Myobject()));
保存顶点时,将自定义对象保存为顶点的值。当我加载 xml 文件时,尽管顶点显示正确,但顶点的值返回 null。换句话说,图形显示很好,但是当我想读取对象的属性甚至移动它时,会出现以下错误:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.mxgraph.swing.handler.mxVertexHandler.createHandles(Unknown Source)
at com.mxgraph.swing.handler.mxCellHandler.refresh(Unknown Source)
at com.mxgraph.swing.handler.mxCellHandler.<init>(Unknown Source)
at com.mxgraph.swing.handler.mxVertexHandler.<init>(Unknown Source)
at com.mxgraph.swing.mxGraphComponent.createHandler(Unknown Source)
at com.mxgraph.swing.handler.mxSelectionCellsHandler.refresh(Unknown Source)
at com.mxgraph.swing.handler.mxSelectionCellsHandler$1.invoke(Unknown Source)
at com.mxgraph.util.mxEventSource.fireEvent(Unknown Source)
at com.mxgraph.util.mxEventSource.fireEvent(Unknown Source)
at com.mxgraph.view.mxGraphSelectionModel$mxSelectionChange.execute(Unknown Source)
at com.mxgraph.view.mxGraphSelectionModel.changeSelection(Unknown Source)
at com.mxgraph.view.mxGraphSelectionModel.setCells(Unknown Source)
at com.mxgraph.view.mxGraphSelectionModel.setCell(Unknown Source)
at com.mxgraph.view.mxGraph.setSelectionCell(Unknown Source)
at com.mxgraph.swing.mxGraphComponent.selectCellForEvent(Unknown Source)
at com.mxgraph.swing.handler.mxGraphHandler.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
这表明该对象为空。我按照文档注册了我的对象。这是图形用户界面:
package graphicalUserInterface;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.LayoutManager;
import java.awt.Point;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.mxgraph.canvas.mxGraphics2DCanvas;
import com.mxgraph.io.mxCodecRegistry;
import com.mxgraph.io.mxObjectCodec;
import com.mxgraph.model.mxCell;
import com.mxgraph.shape.mxStencilShape;
import com.mxgraph.swing.mxGraphComponent;
import com.mxgraph.util.mxConstants;
import com.mxgraph.util.mxEvent;
import com.mxgraph.util.mxEventObject;
import com.mxgraph.util.mxUtils;
import com.mxgraph.util.mxEventSource.mxIEventListener;
import com.mxgraph.view.mxGraph;
import com.mxgraph.view.mxStylesheet;
import netElements.Valve;
public class GUIBoard extends JPanel {
private mxGraph _graph;
private mxGraphComponent _graphComponent;
private JPanel _panel;
private JFrame _frame;
private ArrayList<Valve> _valves;
public GUIBoard(JFrame frame) {
// TODO Auto-generated constructor stub
_frame=frame;
initialize();
}
private void initialize(){
_panel=new JPanel();
_panel.setLayout(new BoxLayout(_panel, BoxLayout.Y_AXIS));
addToRegistry("Images/valve.shape");
/**
* Define a new object to be saved in the Model
*/
mxCodecRegistry.addPackage(Valve.class.getPackage().toString());
mxCodecRegistry.register(new mxObjectCodec(new Valve()));
_graph=new mxGraph() {
public boolean isCellFoldable(Object cell, boolean collapse)
{
return false;
}
public String convertValueToString(Object cell)
{
Object value = null ;
if (cell instanceof mxCell)
{
value = ((mxCell) cell).getValue();
if (value instanceof Valve)
{
Valve v=(Valve) value;
return ((Valve) value).getElementName();
}
}
return super.convertValueToString(value);
}
public boolean isCellResizable(Object cell)
{
return !getModel().isVertex(cell);
}
};
_graph.addListener(mxEvent.MOVE_CELLS, new mxIEventListener()
{
@Override
public void invoke(Object sender, mxEventObject mxevt) {
Object[] cells = (Object[]) mxevt.getProperty("cells");
Point x = (Point) mxevt.getProperty("location");
Double dx = (Double) mxevt.getProperty("dx");
Double dy = (Double) mxevt.getProperty("dy");
}
});
setDefaultConnector();
_graphComponent=new mxGraphComponent(_graph);
_graphComponent.setPreferredSize(new Dimension(600, 400));
this.add(_graphComponent);
_graph.setVertexLabelsMovable(true);
_graph.setDisconnectOnMove(false);
_graph.setConnectableEdges(false);
_graph.setCellsEditable(false);
_graph.setResetEdgesOnMove(true);
_valves=new ArrayList<Valve>();
_panel.add(new GUIBoardToolBars(this).addFileToolBar());
_frame.add(new GUIBoardToolBars(this).addPowerElements(), BorderLayout.EAST);
_frame.add(_panel, BorderLayout.NORTH);
}
public mxGraph getGraph(){
return _graph;
}
public mxGraphComponent getGraphComponent(){
return _graphComponent;
}
private void setDefaultConnector() {
Map<String, Object> connector = new HashMap<String, Object>();
connector.put(mxConstants.STYLE_ROUNDED, false);
connector.put(mxConstants.STYLE_ORTHOGONAL, true);
connector.put(mxConstants.STYLE_EDGE, "elbowEdgeStyle");
connector.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_CONNECTOR);
connector.put(mxConstants.STYLE_ENDARROW, mxConstants.NONE);
mxStylesheet connectorStyle = new mxStylesheet();
connectorStyle.setDefaultEdgeStyle(connector);
_graph.setStylesheet(connectorStyle);
}
public void addValves(Valve valve){
_valves.add(valve);
}
public ArrayList<Valve> getValves(){
return _valves;
}
public void addToRegistry(String element){
String nodeXml, objectName;
mxStencilShape newShape;
try {
nodeXml = mxUtils.readFile(element);
newShape = new mxStencilShape(nodeXml);
objectName = newShape.getName();
mxGraphics2DCanvas.putShape(objectName, newShape);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public GUIBoard(LayoutManager arg0) {
super(arg0);
// TODO Auto-generated constructor stub
}
public GUIBoard(boolean arg0) {
super(arg0);
// TODO Auto-generated constructor stub
}
public GUIBoard(LayoutManager arg0, boolean arg1) {
super(arg0, arg1);
// TODO Auto-generated constructor stub
}
}
GUI 操作是:
package graphicalUserInterface;
import java.awt.MouseInfo;
import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionAdapter;
import java.awt.event.MouseMotionListener;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import javax.swing.AbstractAction;
import org.w3c.dom.Document;
import com.mxgraph.io.mxCodec;
import com.mxgraph.io.mxCodecRegistry;
import com.mxgraph.io.mxObjectCodec;
import com.mxgraph.model.mxCell;
import com.mxgraph.model.mxGeometry;
import com.mxgraph.util.mxUtils;
import com.mxgraph.util.mxXmlUtils;
import netElements.Valve;
public class GUIBoardActions {
public GUIBoardActions() {
// TODO Auto-generated constructor stub
}
public static class NewNetwork extends AbstractAction {
private GUIBoard _newNDB;
public NewNetwork(GUIBoard ndb) {
_newNDB=ndb;
}
@Override
public void actionPerformed(ActionEvent e) {
}
}
public static class OpenNetwork extends AbstractAction {
/**
*
*/
private static final long serialVersionUID = 8166859573134106478L;
private GUIBoard _openNDB;
private Document document;
mxCodec codec ;
public OpenNetwork(GUIBoard ndb) {
_openNDB=ndb;
mxCodecRegistry.addPackage(Valve.class.getPackage().toString());
mxCodecRegistry.register(new mxObjectCodec(new Valve()));
}
@Override
public void actionPerformed(ActionEvent aevt) {
mxCodecRegistry.addPackage(Valve.class.getPackage().toString());
mxCodecRegistry.register(new mxObjectCodec(new Valve()));
try {
document = mxXmlUtils.parseXml(mxUtils.readFile("C:\\test graph/file.xml"));
codec = new mxCodec(document);
codec.decode(document.getDocumentElement(), _openNDB.getGraph().getModel());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
_openNDB.getGraph().getModel().beginUpdate();
Object[] cells;
try
{
cells= _openNDB.getGraph().getChildCells(_openNDB.getGraph().getDefaultParent(), true, true);
}
finally
{
_openNDB.getGraph().getModel().endUpdate();
}
_openNDB.getGraph().addCells(cells);
for (Object c : cells) {
mxCell cell = (mxCell) c;
if (cell.isVertex()) {
if (cell.getValue() instanceof Valve) {
Valve valve=(Valve) cell.getValue();
_openNDB.addValves(valve);
}
}
}
}
}
public static class SaveNetwork extends AbstractAction {
/**
*
*/
private static final long serialVersionUID = 4757526430199667311L;
private GUIBoard _saveNDB;
public SaveNetwork(GUIBoard ndb) {
_saveNDB=ndb;
}
@Override
public void actionPerformed(ActionEvent aevt) {
mxCodec codec = new mxCodec();
try {
String xml2 = mxUtils.getPrettyXml(codec.encode(_saveNDB.getGraph().getModel()));
mxUtils.writeFile(xml2, "C:\\test graph/file.xml");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
public static class AddNewValve extends AbstractAction {
/**
*
*/
private static final long serialVersionUID = 4187443683391653845L;
private GUIBoard _valveNDB;
private MouseMotionListener _boardMotionListener;
private MouseListener _boardListener;
public AddNewValve(GUIBoard ndb){
_valveNDB=ndb;
}
@Override
public void actionPerformed(ActionEvent aevt) {
Valve v = new Valve();
v.setElementNumber(_valveNDB.getValves().size()+1);
v.setElementName("V"+v.getElementNumber());
v.setElementStyleName("VALVE"+v.getElementNumber());
v.setElementStyle(_valveNDB.getGraph());
_valveNDB.addValves(v);
mxCell vCell;
_valveNDB.getGraph().getModel().beginUpdate();
try
{
vCell=(mxCell) _valveNDB.getGraph().insertVertex(_valveNDB.getGraph().getDefaultParent(), null, v, MouseInfo.getPointerInfo().getLocation().x,MouseInfo.getPointerInfo().getLocation().y, 80, 30,v.getElementStyleString());
}
finally
{
_valveNDB.getGraph().getModel().endUpdate();
}
vCell.setAttribute("Name", v.getElementName());
vCell.setConnectable(false);
_valveNDB.getGraphComponent().getGraphControl().addMouseMotionListener(_boardMotionListener=new MouseMotionAdapter() {
@Override
public void mouseDragged(MouseEvent mevt) {
// TODO Auto-generated method stub
}
@Override
public void mouseMoved(MouseEvent mevt) {
vCell.setGeometry(new mxGeometry(mevt.getX(),mevt.getY(),80,30));
_valveNDB.getGraph().refresh();
}
});
_valveNDB.getGraphComponent().getGraphControl().addMouseListener(_boardListener=new MouseListener() {
@Override
public void mouseReleased(MouseEvent mevt) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent mevt) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent mevt) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent mevt) {
// TODO Auto-generated method stub
}
@Override
public void mouseClicked(MouseEvent mevt) {
_valveNDB.getGraphComponent().getGraphControl().removeMouseListener(_boardListener);
_valveNDB.getGraphComponent().getGraphControl().removeMouseMotionListener(_boardMotionListener);
}
});
}
}
}
这是工具栏代码:
package graphicalUserInterface;
import java.awt.Color;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JToolBar;
import javax.swing.UIManager;
import graphicalUserInterface.GUIBoardActions.*;
public class GUIBoardToolBars extends JToolBar {
/**
*
*/
private static final long serialVersionUID = 7241903583392004921L;
GUIBoard _drawingBoard;
//JToolBar _fileToolBar;
public GUIBoardToolBars(GUIBoard ndb) {
_drawingBoard=ndb;
//_fileToolBar=new JToolBar();
}
public JToolBar addFileToolBar(){
JToolBar fileToolBar=new JToolBar();
fileToolBar.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3), getBorder()));
fileToolBar.setFloatable(false);
fileToolBar.setAlignmentX(0);
UIManager.put("ToolTip.background", Color.TRANSLUCENT);
fileToolBar.add(addNewComponent("New", new NewNetwork(_drawingBoard), new ImageIcon("Icon/new.gif"))).setToolTipText("New");
fileToolBar.add(addNewComponent("Open", new OpenNetwork(_drawingBoard), new ImageIcon("Icon/open.gif"))).setToolTipText("Open");
fileToolBar.add(addNewComponent("Save", new SaveNetwork(_drawingBoard), new ImageIcon("Icon/save.gif"))).setToolTipText("Save");
//JButton newFileToolBar=new JButton();
//newFileToolBar.setActionCommand("newFileToolBar");
//newFileToolBar.setIcon(new ImageIcon("Image/new.gif"));
//newFileToolBar.setToolTipText("New");
//fileToolBar.add(newFileToolBar);
return fileToolBar;
}
public JToolBar addPowerElements(){
JToolBar powerElements=new JToolBar(VERTICAL);
powerElements.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(3,3,3,3), getBorder()));
powerElements.setFloatable(false);
powerElements.add(addNewComponent("Valve", new AddNewValve(_drawingBoard), new ImageIcon("Icon/valve1.png"))).setToolTipText("Valve");
return powerElements;
}
@SuppressWarnings("serial")
public Action addNewComponent(String name, Action componentAction, ImageIcon icon){
AbstractAction newComponent=new AbstractAction(name,(icon!=null) ? icon : null){
public void actionPerformed(ActionEvent e)
{
componentAction.actionPerformed(new ActionEvent(_drawingBoard.getGraphComponent(),e.getID(),e.getActionCommand()));
}
};
icon.setDescription(name);
return newComponent;
}
public GUIBoardToolBars(int arg0) {
super(arg0);
// TODO Auto-generated constructor stub
}
public GUIBoardToolBars(String arg0) {
super(arg0);
// TODO Auto-generated constructor stub
}
public GUIBoardToolBars(String arg0, int arg1) {
super(arg0, arg1);
// TODO Auto-generated constructor stub
}
}
最后是自定义对象类:
package netElements;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.mxgraph.model.mxCell;
import com.mxgraph.util.mxConstants;
import com.mxgraph.view.mxGraph;
import com.mxgraph.view.mxStylesheet;
public class Valve implements BasicPropertiesOfElement, Serializable {
/**
*
*/
private static final long serialVersionUID = 6425822395370778513L;
private mxCell _valveCell;
private transient mxStylesheet _valveStyleSheet;
protected int _valveNumber;
private double _valveX, _valveY, _valveRotationalAngle=0;
private String _valveName, _valveStyleName, _valveStyleString="";
public Valve() {
}
public void setElementStyleName(String styleName) {
_valveStyleName=styleName;
}
public String getElementStyleName() {
return _valveStyleName;
}
public void setElementStyle(mxGraph g) {
Map<String, Object> transProperties;
_valveStyleSheet = g.getStylesheet();
transProperties = new HashMap<String, Object>();
transProperties.put(mxConstants.STYLE_SHAPE, "valve");
transProperties.put(mxConstants.STYLE_STROKECOLOR, "black");
transProperties.put(mxConstants.STYLE_ROTATION, _valveRotationalAngle);
transProperties.put(mxConstants.STYLE_VERTICAL_LABEL_POSITION, mxConstants.ALIGN_TOP);
_valveStyleSheet.putCellStyle(_valveStyleName, transProperties);
this.setElementStyleString(transProperties);
}
public mxStylesheet getElementStyle() {
return this._valveStyleSheet;
}
public void setElementStyleString(Map<String, Object> transProperties) {
transProperties.entrySet().stream().forEach(entry ->
_valveStyleString+=entry.getKey()+"="+entry.getValue().toString()+";");
}
public String getElementStyleString() {
return _valveStyleString;
}
@Override
public void setElementRotationalAngle(double angle) {
// TODO Auto-generated method stub
_valveRotationalAngle=angle;
}
@Override
public double getElementRotationalAngle() {
// TODO Auto-generated method stub
return _valveRotationalAngle;
}
@Override
public void setElementNumber(int elementNumber) {
// TODO Auto-generated method stub
_valveNumber=elementNumber;
}
@Override
public int getElementNumber() {
// TODO Auto-generated method stub
return _valveNumber;
}
@Override
public void setElementName(String elementName) {
// TODO Auto-generated method stub
_valveName=elementName;
}
@Override
public String getElementName() {
// TODO Auto-generated method stub
return _valveName;
}
}
我检查了xml文件,发现自定义对象(这里名为Valve)的属性没有显示。基于示例here ,自定义对象应该在 codedc 中注册,其余的将由 JGraph 处理。我不知道该怎么做或应该重写哪个方法来保存自定义对象的属性以及单元格。任何帮助将不胜感激。
最佳答案
我找到了解决方案。对象类(此处为 Valve)中的对象属性应与 getter/setter 方法名称相同。例如,名称为“_valveName”的变量(属性)应与其 getter/setter 方法匹配。这里该变量的 getter/setter 方法是:
公共(public)无效setElementName(字符串元素名称)公共(public)字符串 getElementName()这与变量名不同。因此,通过更改变量名称或 getter/setter 方法名称即可解决问题。这是修改后的自定义对象类:
package netElements;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.mxgraph.model.mxCell;
import com.mxgraph.util.mxConstants;
import com.mxgraph.view.mxGraph;
import com.mxgraph.view.mxStylesheet;
public class Valve implements Serializable {
/**
*
*/
private static final long serialVersionUID = 6425822395370778513L;
protected int valveNumber;
protected String valveName;
private transient mxStylesheet valveStyleSheet;
private mxCell _valveCell;
private double _valveX, _valveY, valveRotationalAngle=0;
protected String valveStyleName, valveStyleString="";
public Valve()
{
}
public void setValveNumber(int elementNumber) {
// TODO Auto-generated method stub
valveNumber=elementNumber;
}
public int getValveNumber() {
// TODO Auto-generated method stub
return valveNumber;
}
public void setValveStyleName(String styleName) {
valveStyleName=styleName;
}
public String getValveStyleName() {
return valveStyleName;
}
public void setValveStyle(mxGraph g) {
Map<String, Object> transProperties;
valveStyleSheet = g.getStylesheet();
transProperties = new HashMap<String, Object>();
transProperties.put(mxConstants.STYLE_SHAPE, "valve");
transProperties.put(mxConstants.STYLE_STROKECOLOR, "black");
transProperties.put(mxConstants.STYLE_ROTATION, valveRotationalAngle);
transProperties.put(mxConstants.STYLE_VERTICAL_LABEL_POSITION, mxConstants.ALIGN_TOP);
valveStyleSheet.putCellStyle(valveStyleName, transProperties);
this.setValveStyleString(transProperties);
}
public mxStylesheet getValveStyle() {
return this.valveStyleSheet;
}
public void setValveStyleString(Map<String, Object> transProperties) {
transProperties.entrySet().stream().forEach(entry ->
valveStyleString+=entry.getKey()+"="+entry.getValue().toString()+";");
}
public String getValveStyleString() {
return valveStyleString;
}
public void setValveRotationalAngle(double angle) {
// TODO Auto-generated method stub
valveRotationalAngle=angle;
}
public double getValveRotationalAngle() {
// TODO Auto-generated method stub
return valveRotationalAngle;
}
public void setValveName(String elementName) {
// TODO Auto-generated method stub
valveName=elementName;
}
public String getValveName() {
// TODO Auto-generated method stub
return this.valveName;
}
}
整个示例可以在 here 找到.
关于java - 使用 JGraphx 在 xml 文件中保存和加载图形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50127916/
我一直在为此而苦苦挣扎。我想插入一个图像,并将其“靠近”讨论该图像的文本,但是该页面上的文本将围绕图像环绕/流动。 我已将图像转换为eps格式。最初,我尝试使用图形环境(\begin {figure}
我在用户界面中创建了管理控制台,管理员可以在其中执行所有操作,例如创建、删除用户、向用户分配应用程序以及从用户界面删除用户的应用程序访问权限 我厌倦了使用 Microsoft 图形 API 和 Azu
我在用户界面中创建了管理控制台,管理员可以在其中执行所有操作,例如创建、删除用户、向用户分配应用程序以及从用户界面删除用户的应用程序访问权限 我厌倦了使用 Microsoft 图形 API 和 Azu
我想为计算机图形学类(class)做一个有趣的项目。我知道那里有很多文献(即 SIGGRAPH session 论文)。我对计算机图形学(即图像处理、3D 建模、渲染、动画)兴趣广泛。但是,我只学了
我试图在 MaterializeCSS 网站上创建一些类似于这个的图形,但我不知道它来自哪里,我查看了整个 MaterializeCSS 网站,它不是框架的一部分,我找不到在代码中他们使用的是什么 我
我有一个包含 1 到 6 之间的各种数字的 TextView ,每个数字在每一行上代表一次,例如 123456 213456 214356 ...... 我希望能够绘制一条蓝线来跟随单个数值在列表中向
我目前在 Windows 7 上使用 Netbeans 和 Cygwin,我希望用 C 语言编写一个简单的 2D 游戏。 我设法找到的大多数教程都使用 Turbo C 提供的 graphics.h,C
亲爱的,我正在尝试将 kaggle 教程代码应用于 Iris 数据集。 不幸的是,当我执行图表的代码时,我只能看到这个输出而看不到任何图表: matplotlib.axes._subplots.Axe
我需要加快我正在处理的一些粒子系统的视觉效果。令人眼前一亮的是添加混合、积累以及粒子上的轨迹和发光。目前我正在手动渲染到浮点图像缓冲区,在最后一分钟转换为无符号字符,然后上传到 OpenGL 纹理。为
在研究跨网络的最短路径算法时,我想生成网络图片。我想代表节点(圆圈)、链接(线)、遍历链接的成本(链接线中间的数字)和链接的容量(链接线上它代表的节点旁边的数字)在这张图中。是否有任何库/软件可以帮助
尽管我已将应用程序从库添加到 Azure AD,但我无法看到何时尝试提取数据。但我可以看到添加的自定义应用程序。就像我添加了 7 个应用程序一样; 2 个来自图库(Google 文档、一个驱动器)和
因此,我正在构建一个系统,该系统具有“人员”,“银行帐户”和“银行帐户交易”。 我需要能够回答以下问题: “将所有与1/2/3度有联系的人归还给特定的人”, “返回年龄在40岁以上的所有人” “从德国
我在 JFrame 构造函数中有以下简单代码 super(name); setBounds(0,0,1100,750); setLayout(null); setVis
(这是java)我有一个椭圆形,代表一个单位。我希望椭圆形的颜色代表单位的健康状况。因此,一个完全健康的单位将是全绿色的。随着单位生命值的降低,椭圆形开始从底部填充红色。因此,在 50% 生命值下,椭
我目前正在开发一个学校项目。我们必须制作一个Applet,我选择了JApplet。由于某种原因,我用来显示特定字符串的面板将不会显示。这里可能有什么问题?请指出我正确的方向。另外,我看了一些教程,
我正在尝试创建一个 Simon game 。我正在编写游戏程序,但遇到了问题。我希望程序从队列中读取游戏中之前存在的所有值,并以正确的顺序将它们的颜色变为闪烁(我选择将它们变为灰色,然后在第二秒后恢复
我正在尝试创建一个框架,该框架在同一框架的顶部有一个图形面板(通过布局),在其下方有一个按钮/标签面板。到目前为止,我似乎已经能够将它们放在同一个框架上,但与按钮/标签面板相比,图形面板非常小....
我用 Java 编写了一个解决数独问题的代码,并使用 Java Applet 来设计它。现在,我尝试使用 Java Swing 使其看起来更好,并添加一些功能,例如“保存”数独板等。不幸的是,我对 J
就目前情况而言,这个问题不太适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、民意调查或扩展讨论。如果您觉得这个问题可以改进并可能重新开放,visit
我现在尝试了 8 个多小时来解决这个问题,但无法弄清楚,请帮助找出我的代码有什么问题。 int main() { int gd = DETECT, gm; float ANGLE =
我是一名优秀的程序员,十分优秀!