@Test public void testPassThrough() { assertEquals(0, clientTabList.getSize()); SimpleTabOverlay tabOverlay = tabOverlayHandler.enterContentOperationMode(ContentOperationMode.SIMPLE); assertEquals(0, clientTabList.getSize()); assertEquals(80, tabOverlay.getMaxSize()); tabOverlay.setSize(1); assertEquals(1, clientTabList.getSize()); tabOverlayHandler.enterContentOperationMode(ContentOperationMode.PASS_TROUGH); assertFalse(tabOverlay.isValid()); assertEquals(0, clientTabList.getSize()); tabOverlay = tabOverlayHandler.enterContentOperationMode(ContentOperationMode.SIMPLE); tabOverlay.setSize(2); assertEquals(2, clientTabList.getSize()); tabOverlay.setSlot(1, Icon.DEFAULT_ALEX, "Slot", 1); assertEquals(2, clientTabList.getSize()); assertArrayEquals("Skin check failed", new String[0][], clientTabList.getProperties(1)); assertEquals("Text check failed", "Slot", clientTabList.getText(1)); assertEquals("Ping check failed", 1, clientTabList.getPing(1)); }
@Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughContentHandler(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandler(); } else { throw new UnsupportedOperationException(); } nextActiveContentHandlerQueue.add(handler); scheduleUpdate(); return (R) handler.getTabOverlay(); }
AbstractTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughContentHandler(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandler(); } else { throw new UnsupportedOperationException(); } nextActiveContentHandlerQueue.add(handler); scheduleUpdate(); return (R) handler.getTabOverlay(); } }
AbstractTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughContentHandler(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandler(); } else { throw new UnsupportedOperationException(); } nextActiveContentHandlerQueue.add(handler); scheduleUpdate(); return (R) handler.getTabOverlay(); } AbstractTabOverlayHandler(Logger logger, Executor eventLoopExecutor, UUID viewerUuid, boolean is18, boolean is13OrLater); }
AbstractTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughContentHandler(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandler(); } else { throw new UnsupportedOperationException(); } nextActiveContentHandlerQueue.add(handler); scheduleUpdate(); return (R) handler.getTabOverlay(); } AbstractTabOverlayHandler(Logger logger, Executor eventLoopExecutor, UUID viewerUuid, boolean is18, boolean is13OrLater); @Override PacketListenerResult onPlayerListPacket(PlayerListItem packet); @Override PacketListenerResult onTeamPacket(Team packet); @Override PacketListenerResult onPlayerListHeaderFooterPacket(PlayerListHeaderFooter packet); @Override void onServerSwitch(boolean is13OrLater); @Override R enterContentOperationMode(ContentOperationMode<R> operationMode); @Override R enterHeaderAndFooterOperationMode(HeaderAndFooterOperationMode<R> operationMode); }
AbstractTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughContentHandler(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandler(); } else { throw new UnsupportedOperationException(); } nextActiveContentHandlerQueue.add(handler); scheduleUpdate(); return (R) handler.getTabOverlay(); } AbstractTabOverlayHandler(Logger logger, Executor eventLoopExecutor, UUID viewerUuid, boolean is18, boolean is13OrLater); @Override PacketListenerResult onPlayerListPacket(PlayerListItem packet); @Override PacketListenerResult onTeamPacket(Team packet); @Override PacketListenerResult onPlayerListHeaderFooterPacket(PlayerListHeaderFooter packet); @Override void onServerSwitch(boolean is13OrLater); @Override R enterContentOperationMode(ContentOperationMode<R> operationMode); @Override R enterHeaderAndFooterOperationMode(HeaderAndFooterOperationMode<R> operationMode);  }