Codota Logo
VirtualScreen
Code IndexAdd Codota to your IDE (free)

How to use
VirtualScreen
in
org.crsh.text

Best Java code snippets using org.crsh.text.VirtualScreen (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: crashub/crash

 public void assertPainted(String s1, String s2) throws Exception {
  TestBuffer tmp = new TestBuffer(2, 2);
  VirtualScreen buffer = new VirtualScreen(tmp);
  buffer.append(s1);
  assertTrue(buffer.isRefresh());
  assertTrue(buffer.paint().isPainting());
  buffer.append(s2);
  assertTrue(buffer.isPainting());
  assertTrue(buffer.paint().isPainted());
 }
}
origin: crashub/crash

} else {
 if (isPainted()) {
  int count = 0;
  int _offset = cursorOffset;
  int _index = cursorIndex;
  while (count < amount) {
   Pair<Integer, Integer> next = nextRow(_offset, _index, width);
   if (next != null) {
    _offset = next.getFirst();
   } else {
    if (nextRow(_offset, _index, 1) != null) {
     count++;
   _index = index;
   for (int i = 0;i < count;i++) {
    Pair<Integer, Integer> next = nextRow(_offset, _index, width);
    _offset = next.getFirst();
    _index = next.getSecond();
origin: crashub/crash

public synchronized boolean nextRow() throws IOException {
 return scroll(1) == 1;
}
origin: crashub/crash

public void testNextRow0() throws Exception {
 TestBuffer tmp = new TestBuffer(2, 2);
 VirtualScreen buffer = new VirtualScreen(tmp);
 assertTrue(buffer.isRefresh());
 assertTrue(buffer.paint().isPainting());
 assertFalse(buffer.nextRow());
 assertTrue(buffer.isPainting());
}
origin: crashub/crash

@Override
public Screenable append(CharSequence csq, int start, int end) throws IOException {
 return append(csq.subSequence(start, end));
}
origin: crashub/crash

public synchronized boolean previousRow() throws IOException {
 // Current strategy is to increment updates, a bit dumb, but fast (in memory) and works
 // correctly
 if (row > 0) {
  int previousOffset = 0;
  int previousIndex = 0;
  int previousRow = 0;
  while (previousRow < row - 1) {
   Pair<Integer, Integer> next = nextRow(previousOffset, previousIndex, width);
   if (next != null) {
    previousOffset = next.getFirst();
    previousIndex = next.getSecond();
    previousRow++;
   } else {
    break;
   }
  }
  status = REFRESH;
  cursorX = cursorY = 0;
  cursorOffset = offset = previousOffset;
  cursorIndex = index = previousIndex;
  row = previousRow;
  return true;
 } else {
  return false;
 }
}
origin: crashub/crash

public void testRefresh() throws Exception {
 TestBuffer tmp = new TestBuffer(2, 2);
 VirtualScreen buffer = new VirtualScreen(tmp);
 tmp.width = 3;
 assertFalse(buffer.update());
}
origin: crashub/crash

@Override
public Screenable append(char c) throws IOException {
 return append(Character.toString(c));
}
origin: com.github.corda.crash/crash.shell

public synchronized boolean previousRow() throws IOException {
 // Current strategy is to increment updates, a bit dumb, but fast (in memory) and works
 // correctly
 if (row > 0) {
  int previousOffset = 0;
  int previousIndex = 0;
  int previousRow = 0;
  while (previousRow < row - 1) {
   Pair<Integer, Integer> next = nextRow(previousOffset, previousIndex, width);
   if (next != null) {
    previousOffset = next.getFirst();
    previousIndex = next.getSecond();
    previousRow++;
   } else {
    break;
   }
  }
  status = REFRESH;
  cursorX = cursorY = 0;
  cursorOffset = offset = previousOffset;
  cursorIndex = index = previousIndex;
  row = previousRow;
  return true;
 } else {
  return false;
 }
}
origin: crashub/crash

public void testNextRow1() throws Exception {
 TestBuffer tmp = new TestBuffer(2, 2);
 VirtualScreen buffer = new VirtualScreen(tmp);
 buffer.append("abcd");
 assertTrue(buffer.isRefresh());
 assertTrue(buffer.paint().isPainted());
 assertFalse(buffer.nextRow());
 assertTrue(buffer.isPainted());
}
origin: org.crashub/crash.shell

} else {
 if (isPainted()) {
  int count = 0;
  int _offset = cursorOffset;
  int _index = cursorIndex;
  while (count < amount) {
   Pair<Integer, Integer> next = nextRow(_offset, _index, width);
   if (next != null) {
    _offset = next.getFirst();
   } else {
    if (nextRow(_offset, _index, 1) != null) {
     count++;
   _index = index;
   for (int i = 0;i < count;i++) {
    Pair<Integer, Integer> next = nextRow(_offset, _index, width);
    _offset = next.getFirst();
    _index = next.getSecond();
origin: com.github.corda.crash/crash.shell

@Override
public Screenable append(CharSequence csq, int start, int end) throws IOException {
 return append(csq.subSequence(start, end));
}
origin: org.crashub/crash.shell

public synchronized boolean previousRow() throws IOException {
 // Current strategy is to increment updates, a bit dumb, but fast (in memory) and works
 // correctly
 if (row > 0) {
  int previousOffset = 0;
  int previousIndex = 0;
  int previousRow = 0;
  while (previousRow < row - 1) {
   Pair<Integer, Integer> next = nextRow(previousOffset, previousIndex, width);
   if (next != null) {
    previousOffset = next.getFirst();
    previousIndex = next.getSecond();
    previousRow++;
   } else {
    break;
   }
  }
  status = REFRESH;
  cursorX = cursorY = 0;
  cursorOffset = offset = previousOffset;
  cursorIndex = index = previousIndex;
  row = previousRow;
  return true;
 } else {
  return false;
 }
}
origin: crashub/crash

public synchronized int nextPage() throws IOException {
 return scroll(height);
}
origin: crashub/crash

private void assertBuffer(int width, int height, String actual, String... test) throws IOException {
 TestBuffer tmp = new TestBuffer(width, height);
 VirtualScreen buffer = new VirtualScreen(tmp);
 for (String a : test) {
  buffer.append(a);
  buffer.paint();
  assertTrue(buffer.isPainting() || buffer.isPainted());
 }
 assertEquals(actual, tmp.toString());
}
origin: com.github.corda.crash/crash.shell

} else {
 if (isPainted()) {
  int count = 0;
  int _offset = cursorOffset;
  int _index = cursorIndex;
  while (count < amount) {
   Pair<Integer, Integer> next = nextRow(_offset, _index, width);
   if (next != null) {
    _offset = next.getFirst();
   } else {
    if (nextRow(_offset, _index, 1) != null) {
     count++;
   _index = index;
   for (int i = 0;i < count;i++) {
    Pair<Integer, Integer> next = nextRow(_offset, _index, width);
    _offset = next.getFirst();
    _index = next.getSecond();
origin: com.github.corda.crash/crash.shell

@Override
public Screenable append(char c) throws IOException {
 return append(Character.toString(c));
}
origin: org.crashub/crash.shell

public synchronized int nextPage() throws IOException {
 return scroll(height);
}
origin: crashub/crash

public void testNextRow2() throws Exception {
 TestBuffer tmp = new TestBuffer(2, 2);
 VirtualScreen buffer = new VirtualScreen(tmp);
 buffer.append("abcde");
 assertTrue(buffer.isRefresh());
 assertTrue(buffer.paint().isPainted());
 assertTrue(buffer.nextRow());
 assertTrue(buffer.isRefresh());
 assertTrue(buffer.paint().isPainting());
 assertFalse(buffer.nextRow());
 assertTrue(buffer.isPainting());
 buffer.append("fg");
 assertTrue(buffer.isPainting());
 assertTrue(buffer.paint().isPainted());
 assertTrue(buffer.nextRow());
 assertTrue(buffer.isRefresh());
 assertTrue(buffer.paint().isPainting());
}
origin: org.crashub/crash.shell

@Override
public Screenable append(CharSequence csq, int start, int end) throws IOException {
 return append(csq.subSequence(start, end));
}
org.crsh.textVirtualScreen

Javadoc

A virtual screen that can be scrolled. This class is thread safe, as it can be used concurrently by two threads, for example one thread can provide new elements while another thread is repainting the buffer to the screen, both threads can either modify the underlying data structure. Paint could also be called concurrently by two threads, one that just provided a new element and wants to repaint the structure and another that changes the current cursor and asks for a repaint too.

Most used methods

  • append
  • isPainted
  • nextRow
  • scroll
  • <init>
  • isPainting
  • isRefresh
  • paint
    Pain the underlying screen context.
  • previousRow
  • update

Popular in Java

  • Making http post requests using okhttp
  • getExternalFilesDir (Context)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • getContentResolver (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • Join (org.hibernate.mapping)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now