test_class.declarator: offer
test_class.modifier: @Mock
  	private
test_class.original_string: @Mock
  	private GrandExchangeOffer offer;
test_class.type: GrandExchangeOffer
test_class.var_name: offer
test_class.file: runelite-client/src/test/java/net/runelite/client/plugins/grandexchange/GrandExchangeOfferSlotTest.java
test_class.identifier: GrandExchangeOfferSlotTest
test_case.body: @Test
  	public void testUpdateOffer()
  	{
  		when(offer.getState()).thenReturn(GrandExchangeOfferState.CANCELLED_BUY);
  
  		GrandExchangeOfferSlot offerSlot = new GrandExchangeOfferSlot();
  		offerSlot.updateOffer(mock(ItemComposition.class), mock(AsyncBufferedImage.class), offer);
  	}
test_case.class_method_signature: GrandExchangeOfferSlotTest.testUpdateOffer()
test_case.full_signature: @Test public void testUpdateOffer()
test_case.identifier: testUpdateOffer
test_case.invocations: thenReturn when getState updateOffer mock mock
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUpdateOffer()
focal_class.declarator: FACE_CARD = "FACE_CARD"
focal_class.modifier: private static final
focal_class.original_string: private static final String FACE_CARD = "FACE_CARD";
focal_class.type: String
focal_class.var_name: FACE_CARD
focal_class.declarator: DETAILS_CARD = "DETAILS_CARD"
focal_class.modifier: private static final
focal_class.original_string: private static final String DETAILS_CARD = "DETAILS_CARD";
focal_class.type: String
focal_class.var_name: DETAILS_CARD
focal_class.declarator: RIGHT_ARROW_ICON
focal_class.modifier: private static final
focal_class.original_string: private static final ImageIcon RIGHT_ARROW_ICON;
focal_class.type: ImageIcon
focal_class.var_name: RIGHT_ARROW_ICON
focal_class.declarator: LEFT_ARROW_ICON
focal_class.modifier: private static final
focal_class.original_string: private static final ImageIcon LEFT_ARROW_ICON;
focal_class.type: ImageIcon
focal_class.var_name: LEFT_ARROW_ICON
focal_class.declarator: container = new JPanel()
focal_class.modifier: private final
focal_class.original_string: private final JPanel container = new JPanel();
focal_class.type: JPanel
focal_class.var_name: container
focal_class.declarator: cardLayout = new CardLayout()
focal_class.modifier: private final
focal_class.original_string: private final CardLayout cardLayout = new CardLayout();
focal_class.type: CardLayout
focal_class.var_name: cardLayout
focal_class.declarator: itemIcon = new JLabel()
focal_class.modifier: private final
focal_class.original_string: private final JLabel itemIcon = new JLabel();
focal_class.type: JLabel
focal_class.var_name: itemIcon
focal_class.declarator: itemName = new JLabel()
focal_class.modifier: private final
focal_class.original_string: private final JLabel itemName = new JLabel();
focal_class.type: JLabel
focal_class.var_name: itemName
focal_class.declarator: offerInfo = new JLabel()
focal_class.modifier: private final
focal_class.original_string: private final JLabel offerInfo = new JLabel();
focal_class.type: JLabel
focal_class.var_name: offerInfo
focal_class.declarator: itemPrice = new JLabel()
focal_class.modifier: private final
focal_class.original_string: private final JLabel itemPrice = new JLabel();
focal_class.type: JLabel
focal_class.var_name: itemPrice
focal_class.declarator: offerSpent = new JLabel()
focal_class.modifier: private final
focal_class.original_string: private final JLabel offerSpent = new JLabel();
focal_class.type: JLabel
focal_class.var_name: offerSpent
focal_class.declarator: progressBar = new ThinProgressBar()
focal_class.modifier: private final
focal_class.original_string: private final ThinProgressBar progressBar = new ThinProgressBar();
focal_class.type: ThinProgressBar
focal_class.var_name: progressBar
focal_class.declarator: showingFace = true
focal_class.modifier: private
focal_class.original_string: private boolean showingFace = true;
focal_class.type: boolean
focal_class.var_name: showingFace
focal_class.file: runelite-client/src/main/java/net/runelite/client/plugins/grandexchange/GrandExchangeOfferSlot.java
focal_class.identifier: GrandExchangeOfferSlot
focal_class.class_method_signature: GrandExchangeOfferSlot.GrandExchangeOfferSlot()
focal_class.full_signature:   GrandExchangeOfferSlot()
focal_class.identifier: GrandExchangeOfferSlot
focal_class.parameters: ()
focal_class.signature:  GrandExchangeOfferSlot()
focal_class.class_method_signature: GrandExchangeOfferSlot.updateOffer(ItemComposition offerItem, BufferedImage itemImage, @Nullable GrandExchangeOffer newOffer)
focal_class.full_signature:  void updateOffer(ItemComposition offerItem, BufferedImage itemImage, @Nullable GrandExchangeOffer newOffer)
focal_class.identifier: updateOffer
focal_class.parameters: (ItemComposition offerItem, BufferedImage itemImage, @Nullable GrandExchangeOffer newOffer)
focal_class.return: void
focal_class.signature: void updateOffer(ItemComposition offerItem, BufferedImage itemImage, @Nullable GrandExchangeOffer newOffer)
focal_class.class_method_signature: GrandExchangeOfferSlot.htmlTooltip(String value)
focal_class.full_signature: private String htmlTooltip(String value)
focal_class.identifier: htmlTooltip
focal_class.modifiers: private
focal_class.parameters: (String value)
focal_class.return: String
focal_class.signature: String htmlTooltip(String value)
focal_class.class_method_signature: GrandExchangeOfferSlot.htmlLabel(String key, String value)
focal_class.full_signature: private String htmlLabel(String key, String value)
focal_class.identifier: htmlLabel
focal_class.modifiers: private
focal_class.parameters: (String key, String value)
focal_class.return: String
focal_class.signature: String htmlLabel(String key, String value)
focal_class.class_method_signature: GrandExchangeOfferSlot.switchPanel()
focal_class.full_signature: private void switchPanel()
focal_class.identifier: switchPanel
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void switchPanel()
focal_class.class_method_signature: GrandExchangeOfferSlot.getProgressColor(GrandExchangeOffer offer)
focal_class.full_signature: private Color getProgressColor(GrandExchangeOffer offer)
focal_class.identifier: getProgressColor
focal_class.modifiers: private
focal_class.parameters: (GrandExchangeOffer offer)
focal_class.return: Color
focal_class.signature: Color getProgressColor(GrandExchangeOffer offer)
focal_class.superclass: extends JPanel
focal_method.body: void updateOffer(ItemComposition offerItem, BufferedImage itemImage, @Nullable GrandExchangeOffer newOffer)
  	{
  		if (newOffer == null || newOffer.getState() == EMPTY)
  		{
  			return;
  		}
  		else
  		{
  			cardLayout.show(container, FACE_CARD);
  
  			itemName.setText(offerItem.getName());
  			itemIcon.setIcon(new ImageIcon(itemImage));
  
  			boolean buying = newOffer.getState() == GrandExchangeOfferState.BOUGHT
  				|| newOffer.getState() == GrandExchangeOfferState.BUYING
  				|| newOffer.getState() == GrandExchangeOfferState.CANCELLED_BUY;
  
  			String offerState = (buying ? "Bought " : "Sold ")
  				+ QuantityFormatter.quantityToRSDecimalStack(newOffer.getQuantitySold()) + " / "
  				+ QuantityFormatter.quantityToRSDecimalStack(newOffer.getTotalQuantity());
  
  			offerInfo.setText(offerState);
  
  			itemPrice.setText(htmlLabel("Price each: ", QuantityFormatter.formatNumber(newOffer.getPrice())));
  
  			String action = buying ? "Spent: " : "Received: ";
  
  			offerSpent.setText(htmlLabel(action, QuantityFormatter.formatNumber(newOffer.getSpent()) + " / "
  				+ QuantityFormatter.formatNumber(newOffer.getPrice() * newOffer.getTotalQuantity())));
  
  			progressBar.setForeground(getProgressColor(newOffer));
  			progressBar.setMaximumValue(newOffer.getTotalQuantity());
  			progressBar.setValue(newOffer.getQuantitySold());
  
  			final JPopupMenu popupMenu = new JPopupMenu();
  			popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
  
  			final JMenuItem openGeLink = new JMenuItem("Open Grand Exchange website");
  			openGeLink.addActionListener(e -> GrandExchangePlugin.openGeLink(offerItem.getName(), offerItem.getId()));
  			popupMenu.add(openGeLink);
  
  			/* Couldn't set the tooltip for the container panel as the children override it, so I'm setting
  			 * the tooltips on the children instead. */
  			for (Component c : container.getComponents())
  			{
  				if (c instanceof JPanel)
  				{
  					JPanel panel = (JPanel) c;
  					panel.setToolTipText(htmlTooltip(((int) progressBar.getPercentage()) + "%"));
  					panel.setComponentPopupMenu(popupMenu);
  				}
  			}
  		}
  
  		revalidate();
  		repaint();
  	}
focal_method.class_method_signature: GrandExchangeOfferSlot.updateOffer(ItemComposition offerItem, BufferedImage itemImage, @Nullable GrandExchangeOffer newOffer)
focal_method.full_signature:  void updateOffer(ItemComposition offerItem, BufferedImage itemImage, @Nullable GrandExchangeOffer newOffer)
focal_method.identifier: updateOffer
focal_method.invocations: getState show setText getName setIcon getState getState getState quantityToRSDecimalStack getQuantitySold quantityToRSDecimalStack getTotalQuantity setText setText htmlLabel formatNumber getPrice setText htmlLabel formatNumber getSpent formatNumber getPrice getTotalQuantity setForeground getProgressColor setMaximumValue getTotalQuantity setValue getQuantitySold setBorder addActionListener openGeLink getName getId add getComponents setToolTipText htmlTooltip getPercentage setComponentPopupMenu revalidate repaint
focal_method.parameters: (ItemComposition offerItem, BufferedImage itemImage, @Nullable GrandExchangeOffer newOffer)
focal_method.return: void
focal_method.signature: void updateOffer(ItemComposition offerItem, BufferedImage itemImage, @Nullable GrandExchangeOffer newOffer)