Giter Club home page Giter Club logo

dragonconsole's Introduction

Dragon Console

Preview

Dragon Console Image 1

About

DragonConsole v3.0.0 beta is finally finished and available for forking as it's been migrated to GitHub. Version 3 is the first to be released as an Open Source project and is a lightweight and useful Terminal Emulator for any Java application designed for any Operation System (with a JVM).

Roadmap

DragonConsole is undergoing some pretty massive changes in it's transition from "v3" to "v4." The largest of which is the migration from Java to Kotlin (which shouldn't affect your ability to use it in a Java program).

The current largest changes:

  • Source has been ported (directly) to Kotlin, doing the best job to keep the exisiting interface intact (hence the current "3.1" version number).
  • The import path was changed from com.eleet.dragonconsole to dev.bbuck.dragonconsole since I don't own com.eleet.

Upcoming larger changes:

  • Ground up rewrite in Kotlin, using Kotlin patterns
  • Saner logic (now that I've had 10 years to grows as an engineer since this was originally written)
  • Implementation of "builders" for the various color codes/input directives and other pieces to make integration of this library easier to read and understand

Building

DragonConsole uses Bazel to build. If you don't already have a means to build your project you should consider this build system. If you want to get the demo up and running simple pull the project down:

$ git clone https://github.com/bbuck/dragonconsole 'DragonConsole'
$ cd DragonConsole

Ensure you have Bazel installed, and run:

$ bazel build //src/main/kotlin/dragonconsole/demo:dragon_console
$ bazel-build/src/main/kotlin/dragonconsole/demo/dragon_console

And that should be it.

DragonConsole v3 Features

  • The ability to Color Text that is output to the Console with simple three character !DragonConsole Color Codes (DCCC).
  • A CommandProcessor to process all input given by the user.
  • Two methods of input. Inline, which allows the user to type directly in the Console (for a Console look and feel) or Separated input which uses an "Input Area" at the bottom of the Console for input.
  • FileProcessor for quick and easy reading of a plain text file and converting it into a String.
  • InputScript which allows the programmer to script input methods directly into Output sent to the console. There are four different types of input, Ranged, Protected Ranged, Infinite, and Protected Infinite.
  • ANSI Color Code support (must be enabled/disabled) with more ANSI Code Support on the way!

dragonconsole's People

Contributors

bbuck avatar computercolin avatar helio-frota avatar marcelcamporelli avatar motoski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dragonconsole's Issues

Why separate Thread in DragonConsole.setScrollBarMax()?

Thanks Brandon for this great console, I like it!
When I use it in connection with the Substance look and feel, I get an exception telling me that no components should be created outside Event Dispatching thread. Swing doesn't like your Thread it seems.
Wouldn't it be better to use SwingUtilities.invokeLater? I don't understand what you wanted to fix with your waiting some millisecs there, but I think invokeLater nicely does...: like so:

protected void setScrollBarMax() {
        final JScrollBar vBar = consoleScrollPane.getVerticalScrollBar();
        final DragonConsole console = this;
        if (isScrollBarAtMax) {
            SwingUtilities.invokeLater(
            new Runnable() {
                public void run() {
                    try {
                        if (vBar.isVisible())
                            vBar.setValue(vBar.getMaximum() - vBar.getModel().getExtent());

                        console.repaint();
                    } catch (Exception exc) {
                        JOptionPane.showMessageDialog(null,
                                "Error #0005\n"
                              + "Failed to set the JScrollBar to Max Value!\n"
                              + exc.getMessage(),
                              "Error Caught", JOptionPane.ERROR_MESSAGE);
                    }
                }
            });
        }
    }

Original code:

 /** 
     * This method creates a thread that will set the
     * <code>consoleScrollPane</code>s Vertical <code>JScrollBar</code> to
     * it's maximum value. The Thread is delayed by a tenth of a second before
     * the value is changed to give time for the computer to fully update the
     * UI and change the JScrollBars value.
     */
    protected void setScrollBarMax() {
        final JScrollBar vBar = consoleScrollPane.getVerticalScrollBar();
        final DragonConsole console = this;
        if (isScrollBarAtMax) {
            new Thread() {
                public void run() {
                    try {
                        sleep(80); // Time out for a tenth of a second
                        if (vBar.isVisible())
                            vBar.setValue(vBar.getMaximum() - vBar.getModel().getExtent());

                        console.repaint();
                    } catch (Exception exc) {
                        JOptionPane.showMessageDialog(null,
                                "Error #0005\n"
                              + "Failed to set the JScrollBar to Max Value!\n"
                              + exc.getMessage(),
                              "Error Caught", JOptionPane.ERROR_MESSAGE);
                    }
                }
            }.start();
        }
    }


Input History

Would it be possible to add history for the input, at least for the current session such that the up arrow shows past commands?

Thanks,
Trevor

Aesh integration

Hi,
I'm trying to understand DragonConsole to do a non-intrusive integration with aesh shell.
Aesh has a lot of built-in commands would be really awesome if DragonConsole run aesh commands. ( 100% java code )
So if do you have any tips to help this integration feel free to contribute.

So DragonConsole will be able to run POSIX based commands like: pwd, cat, ls, clear, exit, mv, rm etc..

what do you think ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.