org.fusesource.jansi.internal.WindowsSupport类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(222)

本文整理了Java中org.fusesource.jansi.internal.WindowsSupport类的一些代码示例,展示了WindowsSupport类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WindowsSupport类的具体详情如下:
包路径:org.fusesource.jansi.internal.WindowsSupport
类名称:WindowsSupport

WindowsSupport介绍

暂无

代码示例

代码示例来源:origin: jline/jline

  1. private static int getWindowsTerminalHeight() {
  2. return WindowsSupport.getWindowsTerminalHeight();
  3. }

代码示例来源:origin: jline/jline

  1. private static int getWindowsTerminalWidth() {
  2. return WindowsSupport.getWindowsTerminalWidth();
  3. }

代码示例来源:origin: jline/jline

  1. private static int getConsoleMode() {
  2. return WindowsSupport.getConsoleMode();
  3. }

代码示例来源:origin: org.aesh/aesh-readline

  1. public Size getSize() {
  2. Size size = new Size(WindowsSupport.getWindowsTerminalWidth(),
  3. WindowsSupport.getWindowsTerminalHeight());
  4. return size;
  5. }

代码示例来源:origin: org.jline/jline

  1. @Override
  2. protected void writeConsole(char[] text, int len) throws IOException {
  3. if (WriteConsoleW(console, text, len, writtenChars, 0) == 0) {
  4. throw new IOException("Failed to write to console: " + WindowsSupport.getLastErrorMessage());
  5. }
  6. }

代码示例来源:origin: jline/jline

  1. private static void setConsoleMode(int mode) {
  2. WindowsSupport.setConsoleMode(mode);
  3. }

代码示例来源:origin: jline/jline

  1. events = WindowsSupport.readConsoleInput(1);
  2. } catch (IOException e) {
  3. Log.debug("read Windows console input error: ", e);

代码示例来源:origin: org.jboss.forge/forge-shell

  1. private int readByte()
  2. {
  3. return WindowsSupport.readByte();
  4. }

代码示例来源:origin: org.jline/jline

  1. private void applyCursorPosition() throws IOException {
  2. info.cursorPosition.x = (short) Math.max(0, Math.min(info.size.x - 1, info.cursorPosition.x));
  3. info.cursorPosition.y = (short) Math.max(0, Math.min(info.size.y - 1, info.cursorPosition.y));
  4. if (SetConsoleCursorPosition(console, info.cursorPosition.copy()) == 0) {
  5. throw new IOException(WindowsSupport.getLastErrorMessage());
  6. }
  7. }

代码示例来源:origin: org.aesh/aesh-readline

  1. @Override
  2. protected void setConsoleMode(int mode) {
  3. WindowsSupport.setConsoleMode(mode);
  4. }

代码示例来源:origin: com.typesafe.sbt/incremental-compiler

  1. events = WindowsSupport.readConsoleInput(1);
  2. } catch (IOException e) {
  3. Log.debug("read Windows console input error: ", e);

代码示例来源:origin: org.scala-lang/jline

  1. private int readByte() {
  2. return WindowsSupport.readByte();
  3. }

代码示例来源:origin: org.jline/jline

  1. private void getConsoleInfo() throws IOException {
  2. out.flush();
  3. if (GetConsoleScreenBufferInfo(console, info) == 0) {
  4. throw new IOException("Could not get the screen info: " + WindowsSupport.getLastErrorMessage());
  5. }
  6. if (negative) {
  7. info.attributes = invertAttributeColors(info.attributes);
  8. }
  9. }

代码示例来源:origin: org.jboss.jreadline/jreadline

  1. @Override
  2. public int getHeight() {
  3. return WindowsSupport.getWindowsTerminalHeight();
  4. }

代码示例来源:origin: org.refcodes/refcodes-runtime

  1. private static int getNativeWindowsWidth() {
  2. if ( _canNativeWindows ) {
  3. try {
  4. return WindowsSupport.getWindowsTerminalWidth();
  5. }
  6. catch ( Error ignore ) {
  7. _canNativeWindows = false;
  8. }
  9. }
  10. return -1;
  11. }

代码示例来源:origin: org.jline/jline

  1. @Override
  2. protected void setConsoleMode(int mode) {
  3. WindowsSupport.setConsoleMode(mode);
  4. }

代码示例来源:origin: org.jline/jline

  1. @Override
  2. protected int getConsoleMode() {
  3. return WindowsSupport.getConsoleMode();
  4. }

代码示例来源:origin: org.aesh/aesh-readline

  1. events = WindowsSupport.readConsoleInput(1);
  2. } catch (IOException e) {
  3. LOGGER.log(Level.INFO, "read Windows terminal input error: ", e);

代码示例来源:origin: org.jboss.forge/forge-shell

  1. @Override
  2. public void run()
  3. {
  4. while (connected)
  5. {
  6. try
  7. {
  8. int read = WindowsSupport.readByte();
  9. blockingQueue.put(read);
  10. Thread.yield();
  11. }
  12. catch (InterruptedException e)
  13. {
  14. // Stop reading
  15. break;
  16. }
  17. }
  18. }
  19. }

代码示例来源:origin: org.fusesource.jansi/jansi

  1. private void applyAttribute() throws IOException {
  2. out.flush(); // expected diff with WindowsAnsiPrintStream.java
  3. short attributes = info.attributes;
  4. if (negative) {
  5. attributes = invertAttributeColors(attributes);
  6. }
  7. if (SetConsoleTextAttribute(console, attributes) == 0) {
  8. throw new IOException(WindowsSupport.getLastErrorMessage());
  9. }
  10. }

相关文章