net.runelite.client.game.ItemManager Java Examples

The following examples show how to use net.runelite.client.game.ItemManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TabInterface.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
@Inject
private TabInterface(
	final Client client,
	final ClientThread clientThread,
	final ItemManager itemManager,
	final TagManager tagManager,
	final TabManager tabManager,
	final ChatboxPanelManager chatboxPanelManager,
	final BankTagsConfig config,
	final Notifier notifier,
	final BankSearch bankSearch,
	final ChatboxItemSearch searchProvider)
{
	this.client = client;
	this.clientThread = clientThread;
	this.itemManager = itemManager;
	this.tagManager = tagManager;
	this.tabManager = tabManager;
	this.chatboxPanelManager = chatboxPanelManager;
	this.config = config;
	this.notifier = notifier;
	this.bankSearch = bankSearch;
	this.searchProvider = searchProvider;
}
 
Example #2
Source File: GrandExchangePanel.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Inject
private GrandExchangePanel(ClientThread clientThread, ItemManager itemManager, ScheduledExecutorService executor)
{
	super(false);

	setLayout(new BorderLayout());
	setBackground(ColorScheme.DARK_GRAY_COLOR);

	// Search Panel
	searchPanel = new GrandExchangeSearchPanel(clientThread, itemManager, executor);

	//Offers Panel
	offersPanel = new GrandExchangeOffersPanel();

	MaterialTab offersTab = new MaterialTab("Offers", tabGroup, offersPanel);
	searchTab = new MaterialTab("Search", tabGroup, searchPanel);

	tabGroup.setBorder(new EmptyBorder(5, 0, 0, 0));
	tabGroup.addTab(offersTab);
	tabGroup.addTab(searchTab);
	tabGroup.select(offersTab); // selects the default selected tab

	add(tabGroup, BorderLayout.NORTH);
	add(display, BorderLayout.CENTER);
}
 
Example #3
Source File: NightmareZoneOverlay.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
@Inject
NightmareZoneOverlay(
	final Client client,
	final NightmareZonePlugin plugin,
	final NightmareZoneConfig config,
	final InfoBoxManager infoBoxManager,
	final ItemManager itemManager)
{
	super(plugin);
	setPosition(OverlayPosition.TOP_LEFT);
	setPriority(OverlayPriority.LOW);
	this.client = client;
	this.plugin = plugin;
	this.config = config;
	this.infoBoxManager = infoBoxManager;
	this.itemManager = itemManager;
	getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "NMZ overlay"));
}
 
Example #4
Source File: SuppliesBox.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
public static SuppliesBox of(
	ItemManager itemManager,
	String id,
	SuppliesTrackerPlugin plugin,
	SuppliesTrackerPanel panel,
	ItemType type)
{
	switch (type)
	{
		case JEWELLERY:
			return new JewellerySuppliesBox(itemManager, id, plugin, panel, type);
		case CHARGES:
			return new ChargesSuppliesBox(itemManager, id, plugin, panel, type);
		case FOOD:
			return new FoodSuppliesBox(itemManager, id, plugin, panel, type);
		case POTION:
			return new PotionSuppliesBox(itemManager, id, plugin, panel, type);
		case DEATH:
			return new DeathSuppliesBox(itemManager, id, plugin, panel, type);
	}

	return new DefaultSuppliesBox(itemManager, id, plugin, panel, type);
}
 
Example #5
Source File: TabInterface.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Inject
private TabInterface(
	final Client client,
	final ClientThread clientThread,
	final ItemManager itemManager,
	final TagManager tagManager,
	final TabManager tabManager,
	final ChatboxPanelManager chatboxPanelManager,
	final BankTagsConfig config,
	final Notifier notifier,
	final BankSearch bankSearch,
	final ChatboxItemSearch searchProvider)
{
	this.client = client;
	this.clientThread = clientThread;
	this.itemManager = itemManager;
	this.tagManager = tagManager;
	this.tabManager = tabManager;
	this.chatboxPanelManager = chatboxPanelManager;
	this.config = config;
	this.notifier = notifier;
	this.bankSearch = bankSearch;
	this.searchProvider = searchProvider;
}
 
Example #6
Source File: RuneLiteModule.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
protected void configure()
{
	bindConstant().annotatedWith(Names.named("developerMode")).to(developerMode);
	bindConstant().annotatedWith(Names.named("safeMode")).to(safeMode);
	bind(File.class).annotatedWith(Names.named("sessionfile")).toInstance(sessionfile);
	bind(File.class).annotatedWith(Names.named("config")).toInstance(config);
	bind(ScheduledExecutorService.class).toInstance(new ExecutorServiceExceptionLogger(Executors.newSingleThreadScheduledExecutor()));
	bind(OkHttpClient.class).toInstance(okHttpClient);
	bind(MenuManager.class);
	bind(ChatMessageManager.class);
	bind(ItemManager.class);
	bind(Scheduler.class);
	bind(PluginManager.class);
	bind(SessionManager.class);

	bind(Callbacks.class).to(Hooks.class);

	bind(EventBus.class)
		.toInstance(new EventBus());

	bind(EventBus.class)
		.annotatedWith(Names.named("Deferred EventBus"))
		.to(DeferredEventBus.class);
}
 
Example #7
Source File: ChatboxItemSearch.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Inject
private ChatboxItemSearch(ChatboxPanelManager chatboxPanelManager, ClientThread clientThread,
	ItemManager itemManager, Client client)
{
	super(chatboxPanelManager, clientThread);
	this.chatboxPanelManager = chatboxPanelManager;
	this.itemManager = itemManager;
	this.client = client;

	lines(1);
	prompt("Item Search");
	onChanged(searchString ->
		clientThread.invokeLater(() ->
		{
			filterResults();
			update();
		}));
}
 
Example #8
Source File: NightmareZoneOverlay.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Inject
NightmareZoneOverlay(
		Client client,
		NightmareZoneConfig config,
		NightmareZonePlugin plugin,
		InfoBoxManager infoBoxManager,
		ItemManager itemManager)
{
	super(plugin);
	setPosition(OverlayPosition.TOP_LEFT);
	setPriority(OverlayPriority.LOW);
	this.client = client;
	this.config = config;
	this.plugin = plugin;
	this.infoBoxManager = infoBoxManager;
	this.itemManager = itemManager;
	getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "NMZ overlay"));
}
 
Example #9
Source File: PortalWeaknessOverlay.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
@Inject
PortalWeaknessOverlay(
	final PestControlPlugin plugin,
	final Client client,
	final ItemManager itemManager,
	final SkillIconManager skillIconManager
)
{
	this.plugin = plugin;
	this.client = client;

	this.magicImage = skillIconManager.getSkillImage(Skill.MAGIC);
	this.rangedImage = skillIconManager.getSkillImage(Skill.RANGED);

	this.stabImage = itemManager.getImage(ItemID.WHITE_DAGGER);
	this.slashImage = itemManager.getImage(ItemID.WHITE_SCIMITAR);
	this.crushImage = itemManager.getImage(ItemID.WHITE_WARHAMMER);

	setPosition(OverlayPosition.DYNAMIC);
	setLayer(OverlayLayer.UNDER_WIDGETS);
}
 
Example #10
Source File: GrandExchangePanel.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
@Inject
private GrandExchangePanel(ClientThread clientThread, ItemManager itemManager, ScheduledExecutorService executor, GrandExchangeConfig config)
{
	super(false);

	setLayout(new BorderLayout());
	setBackground(ColorScheme.DARK_GRAY_COLOR);

	// Search Panel
	searchPanel = new GrandExchangeSearchPanel(clientThread, itemManager, executor);

	//Offers Panel
	offersPanel = new GrandExchangeOffersPanel();

	MaterialTab offersTab = new MaterialTab("Offers", tabGroup, offersPanel);
	searchTab = new MaterialTab("Search", tabGroup, searchPanel);

	tabGroup.setBorder(new EmptyBorder(5, 0, 0, 0));
	tabGroup.addTab(offersTab);
	tabGroup.addTab(searchTab);
	tabGroup.select(offersTab); // selects the default selected tab

	add(tabGroup, BorderLayout.NORTH);
	add(display, BorderLayout.CENTER);
}
 
Example #11
Source File: BirdHouseTabPanel.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
BirdHouseTabPanel(ItemManager itemManager, BirdHouseTracker birdHouseTracker, TimeTrackingConfig config)
{
	this.itemManager = itemManager;
	this.birdHouseTracker = birdHouseTracker;
	this.config = config;
	this.spacePanels = new ArrayList<>();

	setLayout(new DynamicGridLayout(0, 1, 0, 0));
	setBackground(ColorScheme.DARK_GRAY_COLOR);

	boolean first = true;
	for (BirdHouseSpace space : BirdHouseSpace.values())
	{
		TimeablePanel<BirdHouseSpace> panel = new TimeablePanel<>(space, space.getName(), BirdHouseTracker.BIRD_HOUSE_DURATION);

		spacePanels.add(panel);
		add(panel);

		// remove the top border on the first panel
		if (first)
		{
			first = false;
			panel.setBorder(null);
		}
	}
}
 
Example #12
Source File: TPanel.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
@Inject
public TPanel(
	final Client client,
	final DatabaseManager databaseManager,
	final ItemManager itemManager,
	final TMorph plugin,
	final Notifier notifier
)
{
	super(false);
	this.client = client;
	this.databaseManager = databaseManager;
	this.itemManager = itemManager;
	this.plugin = plugin;
	this.notifier = notifier;
	this.equipSlots = new LinkedHashMap<>();
	this.kitToId = new HashMap<>();
	this.setMap = new HashMap<>();
	this.selector = new JComboBox<>();
	this.executor = Executors.newSingleThreadExecutor();
	init();
}
 
Example #13
Source File: BirdHouseTabPanel.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
BirdHouseTabPanel(ItemManager itemManager, BirdHouseTracker birdHouseTracker, TimeTrackingConfig config)
{
	this.itemManager = itemManager;
	this.birdHouseTracker = birdHouseTracker;
	this.config = config;
	this.spacePanels = new ArrayList<>();

	setLayout(new DynamicGridLayout(0, 1, 0, 0));
	setBackground(ColorScheme.DARK_GRAY_COLOR);

	boolean first = true;
	for (BirdHouseSpace space : BirdHouseSpace.values())
	{
		TimeablePanel<BirdHouseSpace> panel = new TimeablePanel<>(space, space.getName(), BirdHouseTracker.BIRD_HOUSE_DURATION);

		spacePanels.add(panel);
		add(panel);

		// remove the top border on the first panel
		if (first)
		{
			first = false;
			panel.setBorder(null);
		}
	}
}
 
Example #14
Source File: BlastMineRockOverlay.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Inject
private BlastMineRockOverlay(Client client, BlastMinePlugin plugin, BlastMinePluginConfig config, ItemManager itemManager)
{
	setPosition(OverlayPosition.DYNAMIC);
	setLayer(OverlayLayer.ABOVE_SCENE);
	this.client = client;
	this.plugin = plugin;
	this.config = config;
	chiselIcon = itemManager.getImage(ItemID.CHISEL);
	dynamiteIcon = itemManager.getImage(ItemID.DYNAMITE);
	tinderboxIcon = itemManager.getImage(ItemID.TINDERBOX);
}
 
Example #15
Source File: BlastMineOreCountOverlay.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Inject
private BlastMineOreCountOverlay(BlastMinePlugin plugin, Client client, BlastMinePluginConfig config, ItemManager itemManager)
{
	super(plugin);
	setPosition(OverlayPosition.TOP_LEFT);
	this.client = client;
	this.config = config;
	this.itemManager = itemManager;
	panelComponent.setOrientation(ComponentOrientation.HORIZONTAL);
	getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Blast mine overlay"));
}
 
Example #16
Source File: LootTrackerBoxTest.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Test
public void testAddKill()
{
	LootTrackerBox lootTrackerBox = new LootTrackerBox(
		mock(ItemManager.class),
		"Theatre of Blood",
		LootRecordType.EVENT,
		null,
		false,
		LootTrackerPriceType.GRAND_EXCHANGE,
		false,
		null, null,
		false);

	LootTrackerItem[] items = new LootTrackerItem[]{
		new LootTrackerItem(ItemID.CLUE_SCROLL_MEDIUM, "Clue scroll (medium)", 1, 0, 0, false),
		new LootTrackerItem(ItemID.CLUE_SCROLL_MEDIUM_3602, "Clue scroll (medium)", 1, 0, 0, false),
		new LootTrackerItem(ItemID.GRACEFUL_HOOD_13579, "Graceful hood", 1, 0, 0, false),
	};
	LootTrackerRecord lootTrackerRecord = new LootTrackerRecord(
		"Theatre of Blood",
		null,
		LootRecordType.EVENT,
		items,
		42
	);

	lootTrackerBox.addKill(lootTrackerRecord);

	assertEquals(Arrays.asList(
		new LootTrackerItem(ItemID.CLUE_SCROLL_MEDIUM, "Clue scroll (medium)", 2, 0, 0, false),
		new LootTrackerItem(ItemID.GRACEFUL_HOOD_13579, "Graceful hood", 1, 0, 0, false)
	), lootTrackerBox.getItems());
}
 
Example #17
Source File: FarmingTracker.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Inject
private FarmingTracker(Client client, ItemManager itemManager, ConfigManager configManager,
	TimeTrackingConfig config, FarmingWorld farmingWorld)
{
	this.client = client;
	this.itemManager = itemManager;
	this.configManager = configManager;
	this.config = config;
	this.farmingWorld = farmingWorld;
}
 
Example #18
Source File: SkillCalculatorPanel.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
SkillCalculatorPanel(SkillIconManager iconManager, Client client, SpriteManager spriteManager, ItemManager itemManager)
{
	super();
	getScrollPane().setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);

	this.iconManager = iconManager;

	setBorder(new EmptyBorder(10, 10, 10, 10));
	setLayout(new GridBagLayout());

	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.HORIZONTAL;
	c.weightx = 1;
	c.gridx = 0;
	c.gridy = 0;

	tabGroup = new MaterialTabGroup();
	tabGroup.setLayout(new GridLayout(0, 6, 7, 7));

	addCalculatorButtons();

	final UICalculatorInputArea uiInput = new UICalculatorInputArea();
	uiInput.setBorder(new EmptyBorder(15, 0, 15, 0));
	uiInput.setBackground(ColorScheme.DARK_GRAY_COLOR);
	uiCalculator = new SkillCalculator(client, uiInput, spriteManager, itemManager);

	add(tabGroup, c);
	c.gridy++;

	add(uiInput, c);
	c.gridy++;

	add(uiCalculator, c);
	c.gridy++;
}
 
Example #19
Source File: SkillCalculator.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
SkillCalculator(Client client, UICalculatorInputArea uiInput, SpriteManager spriteManager, ItemManager itemManager)
{
	this.client = client;
	this.uiInput = uiInput;
	this.spriteManager = spriteManager;
	this.itemManager = itemManager;

	combinedActionSlot = new UICombinedActionSlot(spriteManager);

	searchBar.setIcon(IconTextField.Icon.SEARCH);
	searchBar.setPreferredSize(new Dimension(PluginPanel.PANEL_WIDTH - 20, 30));
	searchBar.setBackground(ColorScheme.DARKER_GRAY_COLOR);
	searchBar.setHoverBackgroundColor(ColorScheme.DARK_GRAY_HOVER_COLOR);
	searchBar.addClearListener(this::onSearch);
	searchBar.addKeyListener(e -> onSearch());

	setLayout(new DynamicGridLayout(0, 1, 0, 5));

	// Register listeners on the input fields and then move on to the next related text field
	uiInput.getUiFieldCurrentLevel().addActionListener(e ->
	{
		onFieldCurrentLevelUpdated();
		uiInput.getUiFieldTargetLevel().requestFocusInWindow();
	});

	uiInput.getUiFieldCurrentXP().addActionListener(e ->
	{
		onFieldCurrentXPUpdated();
		uiInput.getUiFieldTargetXP().requestFocusInWindow();
	});

	uiInput.getUiFieldTargetLevel().addActionListener(e -> onFieldTargetLevelUpdated());
	uiInput.getUiFieldTargetXP().addActionListener(e -> onFieldTargetXPUpdated());

	// Register focus listeners to calculate xp when exiting a text field
	uiInput.getUiFieldCurrentLevel().addFocusListener(buildFocusAdapter(e -> onFieldCurrentLevelUpdated()));
	uiInput.getUiFieldCurrentXP().addFocusListener(buildFocusAdapter(e -> onFieldCurrentXPUpdated()));
	uiInput.getUiFieldTargetLevel().addFocusListener(buildFocusAdapter(e -> onFieldTargetLevelUpdated()));
	uiInput.getUiFieldTargetXP().addFocusListener(buildFocusAdapter(e -> onFieldTargetXPUpdated()));
}
 
Example #20
Source File: InventoryGridOverlay.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Inject
private InventoryGridOverlay(InventoryGridConfig config, Client client, ItemManager itemManager)
{
	this.itemManager = itemManager;
	this.client = client;
	this.config = config;

	setPosition(OverlayPosition.DYNAMIC);
	setLayer(OverlayLayer.ABOVE_WIDGETS);
}
 
Example #21
Source File: BirdHouseTracker.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Inject
private BirdHouseTracker(Client client, ItemManager itemManager, ConfigManager configManager,
	TimeTrackingConfig config, Notifier notifier)
{
	this.client = client;
	this.itemManager = itemManager;
	this.configManager = configManager;
	this.config = config;
	this.notifier = notifier;
}
 
Example #22
Source File: FishingSpotOverlay.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Inject
private FishingSpotOverlay(FishingPlugin plugin, FishingConfig config, Client client, ItemManager itemManager)
{
	setPosition(OverlayPosition.DYNAMIC);
	setLayer(OverlayLayer.ABOVE_SCENE);
	this.plugin = plugin;
	this.config = config;
	this.client = client;
	this.itemManager = itemManager;
}
 
Example #23
Source File: WoodcuttingTreesOverlay.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Inject
private WoodcuttingTreesOverlay(final Client client, final WoodcuttingConfig config, final ItemManager itemManager, final WoodcuttingPlugin plugin)
{
	this.client = client;
	this.config = config;
	this.itemManager = itemManager;
	this.plugin = plugin;
	setLayer(OverlayLayer.ABOVE_SCENE);
	setPosition(OverlayPosition.DYNAMIC);
}
 
Example #24
Source File: FishingSpotOverlay.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
@Inject
private FishingSpotOverlay(final FishingPlugin plugin, final FishingConfig config, final Client client, final ItemManager itemManager)
{
	setPosition(OverlayPosition.DYNAMIC);
	setLayer(OverlayLayer.ABOVE_SCENE);
	this.plugin = plugin;
	this.config = config;
	this.client = client;
	this.itemManager = itemManager;
}
 
Example #25
Source File: PrayerAlertOverlay.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
@Inject
private PrayerAlertOverlay(final Client client, final PrayerAlertConfig config, final ItemManager itemManager)
{
	setPosition(OverlayPosition.TOP_RIGHT);
	setPriority(OverlayPriority.LOW);
	this.client = client;
	this.config = config;
	this.itemManager = itemManager;
}
 
Example #26
Source File: OverviewTabPanel.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
OverviewTabPanel(ItemManager itemManager, TimeTrackingConfig config, TimeTrackingPanel pluginPanel,
				FarmingTracker farmingTracker, BirdHouseTracker birdHouseTracker, ClockManager clockManager,
				FarmingContractManager farmingContractManager)
{
	this.config = config;
	this.farmingTracker = farmingTracker;
	this.birdHouseTracker = birdHouseTracker;
	this.clockManager = clockManager;
	this.farmingContractManager = farmingContractManager;

	setLayout(new GridLayout(0, 1, 0, 8));
	setBackground(ColorScheme.DARK_GRAY_COLOR);

	timerOverview = new OverviewItemPanel(itemManager, pluginPanel, Tab.CLOCK, "Timers");
	add(timerOverview);

	stopwatchOverview = new OverviewItemPanel(itemManager, pluginPanel, Tab.CLOCK, "Stopwatches");
	add(stopwatchOverview);

	birdHouseOverview = new OverviewItemPanel(itemManager, pluginPanel, Tab.BIRD_HOUSE, "Bird Houses");
	add(birdHouseOverview);

	farmingOverviews = Stream.of(Tab.FARMING_TABS)
		.filter(v -> v != Tab.OVERVIEW)
		.collect(ImmutableMap.toImmutableMap(
			Function.identity(),
			t ->
			{
				OverviewItemPanel p = new OverviewItemPanel(itemManager, pluginPanel, t, t.getName());
				add(p);
				return p;
			}
		));

	farmingContractOverview = new OverviewItemPanel(itemManager, () -> pluginPanel.switchTab(farmingContractManager.getContractTab()),
		farmingContractManager::hasContract, ItemID.SEED_PACK, "Farming Contract");
	add(farmingContractOverview);
}
 
Example #27
Source File: BirdHouseTracker.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
@Inject
private BirdHouseTracker(Client client, ItemManager itemManager, ConfigManager configManager,
						TimeTrackingConfig config, Notifier notifier)
{
	this.client = client;
	this.itemManager = itemManager;
	this.configManager = configManager;
	this.config = config;
	this.notifier = notifier;
}
 
Example #28
Source File: TimeTrackingPanel.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
TimeTrackingPanel(ItemManager itemManager, TimeTrackingConfig config,
				FarmingTracker farmingTracker, BirdHouseTracker birdHouseTracker, ClockManager clockManager,
				FarmingContractManager farmingContractManager)
{
	super(false);

	this.itemManager = itemManager;
	this.config = config;

	setLayout(new BorderLayout());
	setBackground(ColorScheme.DARK_GRAY_COLOR);

	display.setBorder(new EmptyBorder(10, 10, 8, 10));

	tabGroup.setLayout(new GridLayout(0, 6, 7, 7));
	tabGroup.setBorder(new EmptyBorder(10, 10, 0, 10));

	add(tabGroup, BorderLayout.NORTH);
	add(display, BorderLayout.CENTER);

	addTab(Tab.OVERVIEW, new OverviewTabPanel(itemManager, config, this, farmingTracker, birdHouseTracker, clockManager,
		farmingContractManager));
	addTab(Tab.CLOCK, clockManager.getClockTabPanel());
	addTab(Tab.BIRD_HOUSE, birdHouseTracker.createBirdHouseTabPanel());

	for (Tab tab : Tab.FARMING_TABS)
	{
		addTab(tab, farmingTracker.createTabPanel(tab, farmingContractManager));
	}
}
 
Example #29
Source File: FarmingTracker.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
@Inject
private FarmingTracker(Client client, ItemManager itemManager, ConfigManager configManager, TimeTrackingConfig config, FarmingWorld farmingWorld)
{
	this.client = client;
	this.itemManager = itemManager;
	this.configManager = configManager;
	this.config = config;
	this.farmingWorld = farmingWorld;
}
 
Example #30
Source File: SkillCalculator.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
SkillCalculator(Client client, UICalculatorInputArea uiInput, SpriteManager spriteManager, ItemManager itemManager)
{
	this.client = client;
	this.uiInput = uiInput;
	this.spriteManager = spriteManager;
	this.itemManager = itemManager;

	combinedActionSlot = new UICombinedActionSlot(spriteManager);

	searchBar.setIcon(IconTextField.Icon.SEARCH);
	searchBar.setPreferredSize(new Dimension(PluginPanel.PANEL_WIDTH - 20, 30));
	searchBar.setBackground(ColorScheme.DARKER_GRAY_COLOR);
	searchBar.setHoverBackgroundColor(ColorScheme.DARK_GRAY_HOVER_COLOR);
	searchBar.addClearListener(this::onSearch);
	searchBar.addKeyListener(e -> onSearch());

	setLayout(new DynamicGridLayout(0, 1, 0, 5));

	// Register listeners on the input fields and then move on to the next related text field
	uiInput.getUiFieldCurrentLevel().addActionListener(e ->
	{
		onFieldCurrentLevelUpdated();
		uiInput.getUiFieldTargetLevel().requestFocusInWindow();
	});

	uiInput.getUiFieldCurrentXP().addActionListener(e ->
	{
		onFieldCurrentXPUpdated();
		uiInput.getUiFieldTargetXP().requestFocusInWindow();
	});

	uiInput.getUiFieldTargetLevel().addActionListener(e -> onFieldTargetLevelUpdated());
	uiInput.getUiFieldTargetXP().addActionListener(e -> onFieldTargetXPUpdated());

	// Register focus listeners to calculate xp when exiting a text field
	uiInput.getUiFieldCurrentLevel().addFocusListener(buildFocusAdapter(e -> onFieldCurrentLevelUpdated()));
	uiInput.getUiFieldCurrentXP().addFocusListener(buildFocusAdapter(e -> onFieldCurrentXPUpdated()));
	uiInput.getUiFieldTargetLevel().addFocusListener(buildFocusAdapter(e -> onFieldTargetLevelUpdated()));
	uiInput.getUiFieldTargetXP().addFocusListener(buildFocusAdapter(e -> onFieldTargetXPUpdated()));
}