小编Exo*_*com的帖子

Eclipse的UML插件 - 类图和Java代码生成 - Indigo/Juno

我正在为Eclipse寻找一个UML插件.我知道这几个问题已被问过几次,但大多数都是几年前的问题.根据我的阅读,我会说大多数人更喜欢eUML2,但这只官方支持Helios.

到目前为止,我使用的是argoUML,但缺少一个撤销按钮实际上是一个可用性的噩梦,至少可以说.另外,我更喜欢集成到Eclipse中.

我想要的是:

  • 自由/开源
  • 积极开发的工具(支持Indigo,计划支持Juno)
  • 在Eclipse中轻松安装
  • 类图
  • 从图中生成Java代码
  • 实施完成后更新类图(往返)

什么会很好:

  • 其他图表,对我来说最重要的是序列和用例图

如果实际上没有合适的Eclipse插件,那么如果你能指出其他免费/开源和基于linux的工具以及你用来完成上述要求的工作流程,我会很高兴.

java eclipse uml eclipse-plugin

13
推荐指数
2
解决办法
6万
查看次数

仅绘制小提琴图的一侧/一半

我想要只有一半的小提琴图(类似于 ggridges 的 stat_density_ridges 创建的图)。MWE

library(ggplot2)

dframe = data.frame(val = c(), group = c())
for(i in 1:5){
  offset = i - 3
  dframe = rbind(dframe, 
                 data.frame(val = rnorm(n = 50, mean = 0 - offset), group = i)
                 )
}
dframe$group = as.factor(dframe$group)

ggplot(data = dframe, aes(x = group, y = val)) + 
  geom_violin()      
Run Code Online (Sandbox Code Playgroud)

产生这样的情节

在此处输入图片说明

我虽然想要一个看起来像这样的:

在此处输入图片说明

理想情况下,这些图也可以缩放到宽度的 1.5 到 2 倍。

r ggplot2 violin-plot

7
推荐指数
1
解决办法
4241
查看次数

使用JAXB解组xml - 使用XmlType和proporder的命名空间

我正在尝试使用JAXB解组xml文件.当我使用具有正确名称和命名空间的@XmlElement时,解组工作(例如@XmlElement(name ="name",namespace ="http://www.test.com"))

如果我与propOrder一起使用XmlType,那么遗憾的是它不再存在(例如@XmlType(namespace ="http://www.test.com",name ="",propOrder = {"name","description"})).

xml文件的内容(test.xml):

<Operation xmlns="http://www.test.com">
  <Parameter>
    <name>Param1</name>
    <description>Description of Parameter1</description>
  </Parameter>
  <Parameter>
    <name>Param2</name>
    <description>Description of Parameter2</description>
  </Parameter>
</Operation>
Run Code Online (Sandbox Code Playgroud)

JAXBExample.java的内容是:

package stackoverflow.problem.jaxb.ns;

import java.io.FileNotFoundException;
import java.io.FileReader;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;

public class JAXBExample {

  public static void main(String[] args) throws JAXBException, FileNotFoundException   {
  String xmlFilename = "test.xml";

    JAXBContext context = JAXBContext.newInstance(Operation.class);

    System.out.println("Output from our XML File: ");
    Unmarshaller um = context.createUnmarshaller();
    Operation op = (Operation) um.unmarshal(new FileReader(xmlFilename));

    System.out.println("Operation-Content: " + op);
  }

} …
Run Code Online (Sandbox Code Playgroud)

java jaxb unmarshalling

5
推荐指数
1
解决办法
1万
查看次数

如何从FileUtils(Apache Commons IO 2.4)继续使用copyDirectory进行错误复制

我正在尝试使用以下代码从Apache Commons io(2.4)使用FileUtils方法“ static void copyDirectory(File srcDir,File destDir)”将文件从一个文件夹复制到另一个文件夹:

String srcDir  = "/sourceDirectory/examples/";
String destDir = "/tmp/examples/";
try{
    FileUtils.copyDirectory(new File(srcDir), new File(destDir));
} catch (IOException e){
    e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)

文件结构如下所示:

examples/                           (read access)
examples/.subdirectory              (NO access)
examples/file1.txt                  (read access)
examples/file2.txt                  (read access)
examples/subdirectory2/file1.txt    (read access)
examples/subdirectory2/file2.txt    (NO access)
Run Code Online (Sandbox Code Playgroud)

问题是,在srcDir中有一些文件和一个我无权访问的子目录。FileUtils.copyDirectory抛出“ java.io.FileNotFoundException:.subdirectory(权限被拒绝)”并中止。

是否可以忽略我无权访问的那些文件,而仅复制我可以读取的所有其他文件?

java fileutils apache-commons-io

3
推荐指数
1
解决办法
1974
查看次数