彭博终端的现代命令行编程
我想构建一个财务分析工具,其中包含一系列多样化的动态选项。屏幕将根据之前屏幕的输入而变化。任何单个屏幕都可以有数百个选项,其中大部分将在列表中列出。我认为使用常规 GUI 样式创建应用程序会很困难且缓慢。
我想在类似命令行的环境中构建我的软件。我认为最接近我想要的东西是彭博终端。
是否有任何工具、工具包、环境等可以用来在完全空白的石板上构建我的应用程序,并且我可以不断更改?我需要能够绘制图表,并且希望图形具有尽可能多的灵活性。彭博社的人以某种方式做到了这一点。谁能给我一些建议吗?
我考虑过使用基于浏览器的方法,但我更喜欢更原生的方法。
如果重要的话,我最想使用 Java 和/或 jRuby 进行编码。
谢谢!
请注意,无论该方法的优点如何(根据您的观点),我都有一个有效的技术问题。
I want build a financial analysis tool that will feature screen after screen of diverse, dynamic options. The screens will change based on the input from the previous screens. Any single screen can have hundreds of options, most of which will be listed in lists. I think creating my application using a regular gui style will be difficult and slow.
I'd like to build my software in a command-line like environment. I think the closest thing to what I'm going for is a Bloomberg terminal.
Are there any tools, toolkits, environments, etc that I can use to build my app on a totally blank slate that I can constantly change? I need to be able to draw charts and would love as much flexibility in graphics as possible. The folks at Bloomberg somehow do this. Can anyone give me some tips?
I have considered using a browser-based approach but I would much prefer something more native.
If it matters I'd most like to code in Java and/or jRuby.
Thanks!
Please note that regardless of the merits of the approach (per your view), I have a valid technical question.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要阅读文本终端仿真和ANSI 转义码(用于绘图、光标放置等)。另请参阅此。
我强烈建议您考虑 EXEL,因为这是华尔街选择的 UI。我也不相信 GUI 的效率会(严重)降低,但 GUI 并不是所有用户界面的最终目的。如果您认为基于文本的虚拟终端方法是最好的,那就去吧!
[编辑:另请参阅此开源 Java 模拟器项目]
You'll need to read up on text terminal emulation and ANSI escape codes (for drawing, cursor placement, etc.). See also this.
I would strongly suggest you consider EXEL as that is the UI of choice on Wall Street. I am also not convinced that a GUI would be (grossly) less efficient but GUIs are not the end all be all of user interfaces. If you believe a text-based virtual terminal approach is best, then go for it!
[edit: See also this open source Java emulator projects]
好吧,如果你想绘制图形,你最终必须选择一些基本的图形库来绘制图表。我建议使用 JFreeCharts 因为它是一个 API,可以构建图表,而无需逐行绘制图表永远不会想做。
对于控制台输入,您可以使用 Java6 中的 Console。这比使用 System.in、System.out 更好。
http://download.oracle.com/javase/6 /docs/api/java/io/Console.html
至于不构建 GUI,您可以在 Swing 中构建命令行操作,以便可以编写脚本,但支持直接命令行无法实现的更复杂的编辑加工。实际上,我开始构建一个框架来构建在 Swing 窗口内运行的命令行工具,以便您可以获得更好的编辑,但我还没有开源它。
如果您坚决不使用像 Swing 这样的 UI 工具包,那么您可以使用 BufferedImage:
http://download.oracle.com/javase/6/docs/api/java/awt/image/BufferedImage.html
绘制任何你想要的图形,但你会基本上是在学习Java2D,将图形逐像素渲染到 BufferedImage 中,并将其保存到文件而不是屏幕中。我想你会发现这条路线很难从中构建结果,但你实际上可以渲染任何你想要的东西。
Well if you want to draw graphics you'll have to eventually pick up some basic graphics libraries to draw charts. I'd suggest using JFreeCharts because it's an API to build the charting without drawing line by line which you'll never want to do.
For console input you can use Console in Java6. That's better than using System.in, System.out.
http://download.oracle.com/javase/6/docs/api/java/io/Console.html
As for not building a GUI you could build a command line operation in Swing so that you can script it, but support more complex editing that's not possible with straight command line processing. I actually started to build a framework for building command line tools that run inside a swing window so you can get nicer editing, but I haven't open sourced it yet.
If you're adamant about not using a UI toolkit like Swing then you can use BufferedImage:
http://download.oracle.com/javase/6/docs/api/java/awt/image/BufferedImage.html
To draw any graphics you want, but you'll basically be learning Java2D, and rendering graphics pixel by pixel into a BufferedImage and save that to a file instead of the screen. I think you'll find this route very difficult to build results out of it, but you can literally render anything you want.
我想到了SDL。虽然是为游戏开发的,但它可以让您完全控制图形输出。有针对 Java 和 Ruby 的绑定。
维基百科有很好的概述
SDL comes to mind. Although developed for games, it gives you complete control over graphics output. There's bindings for Java as well as Ruby.
Wikipedia has a good overview