delta-leonis / torch Goto Github PK
View Code? Open in Web Editor NEWreactive lanterna extension
Home Page: http://leonis.io/
License: GNU Affero General Public License v3.0
reactive lanterna extension
Home Page: http://leonis.io/
License: GNU Affero General Public License v3.0
LineGraph
needs to be split up to use a separate data container. My suggestion for this data container is that it's simply a wrapper for List<Double>
. Removing the need for getMin
and getMax
methods on LineGraph
itself.
Also it might be possible to combine the two IntStreams
into one.
We need a component which can act as an EmptySpace
but with a centered text (such as a logo).
A snippet to get started:
package io.leonis.torch.component;
import com.googlecode.lanterna.*;
import com.googlecode.lanterna.gui2.*;
import java.awt.Color;
import lombok.*;
/**
* The Class TextBackground
*
* This class is basically an {@link EmptySpace} with a text on top. The text is a tint brighter
* than the background color and will be centered based on the current size of the {@link
* com.googlecode.lanterna.screen.Screen}
*
* @author Jeroen de Jong
*/
@Value
@EqualsAndHashCode(callSuper = true)
public final class TextBackground extends AbstractComponent<TextBackground> {
/**
* Background label
*/
private final String text;
private final TextColor color;
@Override
protected ComponentRenderer<TextBackground> createDefaultRenderer() {
return new ComponentRenderer<TextBackground>() {
@Override
public TerminalSize getPreferredSize(final TextBackground component) {
return component.getParent().getSize();
}
@Override
public void drawComponent(final TextGUIGraphics graphics, final TextBackground component) {
// TODO this needs some cleanup; also the text should be centered
graphics.applyThemeStyle(component.getThemeDefinition().getNormal());
graphics.setBackgroundColor(component.getColor());
graphics.fill(' ');
final Label text = new Label(component.getText());
text.setBackgroundColor(component.getColor());
final Color brighterColor = component.getColor().toColor().brighter();
text.setForegroundColor(
new TextColor.RGB(brighterColor.getRed(), brighterColor.getGreen(),
brighterColor.getBlue()));
text.draw(graphics);
}
};
}
}
The documentation of KeyStroke#getCharacter
says:
returns:
Character value of the key pressed, or null if it was a special key
However the result of character is directly compared here:
torch/src/main/java/io/leonis/torch/handlers/CycleWindowHandler.java
Lines 22 to 26 in d9a8bf3
It should be checked whether the KeyStroke#getKeyType
is actually a KeyType.Character
before checking if KeyStroke#getCharacter
is the correct one.
filed under copyright
header. see algieba
The Javadoc should be deployed to GitHub pages when new code is pushed to master.
see config.yml and gh-pages.sh in zosma
Such as the other projects the CI should fail if javadoc is missing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.